Search in sources :

Example 1 with ConnectMessage

use of com.corundumstudio.socketio.store.pubsub.ConnectMessage in project netty-socketio by mrniko.

the class AuthorizeHandler method connect.

public void connect(ClientHead client) {
    Namespace ns = namespacesHub.get(Namespace.DEFAULT_NAME);
    if (!client.getNamespaces().contains(ns)) {
        Packet packet = new Packet(PacketType.MESSAGE);
        packet.setSubType(PacketType.CONNECT);
        client.send(packet);
        configuration.getStoreFactory().pubSubStore().publish(PubSubType.CONNECT, new ConnectMessage(client.getSessionId()));
        SocketIOClient nsClient = client.addNamespaceClient(ns);
        ns.onConnect(nsClient);
    }
}
Also used : Packet(com.corundumstudio.socketio.protocol.Packet) AuthPacket(com.corundumstudio.socketio.protocol.AuthPacket) SocketIOClient(com.corundumstudio.socketio.SocketIOClient) ConnectMessage(com.corundumstudio.socketio.store.pubsub.ConnectMessage) Namespace(com.corundumstudio.socketio.namespace.Namespace)

Aggregations

SocketIOClient (com.corundumstudio.socketio.SocketIOClient)1 Namespace (com.corundumstudio.socketio.namespace.Namespace)1 AuthPacket (com.corundumstudio.socketio.protocol.AuthPacket)1 Packet (com.corundumstudio.socketio.protocol.Packet)1 ConnectMessage (com.corundumstudio.socketio.store.pubsub.ConnectMessage)1