Browse Source

Some comments added

master
Nikita 12 years ago
parent
commit
19d8da3ee0
  1. 10
      src/main/java/com/corundumstudio/socketio/SocketIOClient.java
  2. 9
      src/main/java/com/corundumstudio/socketio/SocketIOServer.java

10
src/main/java/com/corundumstudio/socketio/SocketIOClient.java

@ -91,8 +91,18 @@ public interface SocketIOClient extends ClientOperations {
*/ */
boolean isChannelOpen(); boolean isChannelOpen();
/**
* Join client to room
*
* @param roomKey - any object with correct hashcode & equals implementation
*/
<T> void joinRoom(T roomKey); <T> void joinRoom(T roomKey);
/**
* Join client to room
*
* @param roomKey - any object with correct hashcode & equals implementation
*/
<T> void leaveRoom(T roomKey); <T> void leaveRoom(T roomKey);
} }

9
src/main/java/com/corundumstudio/socketio/SocketIOServer.java

@ -60,7 +60,7 @@ public class SocketIOServer implements ClientListeners {
/** /**
* Get all clients * Get all clients
* *
* @return Iterable object with clients
* @return clients collection
*/ */
public Collection<SocketIOClient> getAllClients() { public Collection<SocketIOClient> getAllClients() {
return pipelineFactory.getAllClients(); return pipelineFactory.getAllClients();
@ -70,6 +70,13 @@ public class SocketIOServer implements ClientListeners {
return getBroadcastOperations(pipelineFactory.getAllClients()); return getBroadcastOperations(pipelineFactory.getAllClients());
} }
/**
* Get broadcast operations for clients within
* room by <code>roomKey</code>
*
* @param roomKey - any object with correct hashcode & equals implementation
* @return
*/
public <T> BroadcastOperations getRoomOperations(T roomKey) { public <T> BroadcastOperations getRoomOperations(T roomKey) {
Iterable<SocketIOClient> clients = namespacesHub.getRoomClients(roomKey); Iterable<SocketIOClient> clients = namespacesHub.getRoomClients(roomKey);
return new BroadcastOperations(clients); return new BroadcastOperations(clients);

Loading…
Cancel
Save