package com.github.flowersinthesand.jquerysocket;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Sockets {

	private SocketAcceptor acceptor;
	private Map<String, Socket> instances = new ConcurrentHashMap<String, Socket>();

	public void add(final Socket socket) {
		instances.put(socket.id(), socket.on("close", new Socket.EventHandler<Object>() {
			@Override
			public void handle(Object data) {
				instances.remove(socket.id());
			}
		}));
		acceptor.doSocketConnect(socket);
	}

	public boolean has(String id) {
		return instances.containsKey(id);
	}

	public Socket get(String id) {
		return instances.get(id);
	}

	public void remove(String id) {
		instances.remove(id);
	}

	public Map<String, Socket> getMap() {
		return instances;
	}

	public void setAcceptor(SocketAcceptor acceptor) {
		this.acceptor = acceptor;
	}

}

@@ -46,16 +46,69 @@
 ket;%0D%0A%0D%0A
+import java.util.ArrayList;%0D%0Aimport java.util.List;%0D%0A
 import j
@@ -723,32 +723,125 @@
 es.get(id);%0D%0A%09%7D%0D
+%0A%09%0D%0A%09public List%3CSocket%3E getAll() %7B%0D%0A%09%09return new ArrayList%3CSocket%3E(instances.values());%0D%0A%09%7D%0D
 %0A%0D%0A%09public void 

Add the getAll method to Sockets class