Session.ConnectionListener

public abstract static interface ConnectionListener

Enclosing class: Session

Monitors when other clients connect and disconnect to the session.

Methods

Name Description
onConnectionCreated(session, connection) Invoked when another client connects to the session.
onConnectionDestroyed(session, connection) Invoked when another client leaves the session.

onConnectionCreated(session, connection)

Invoked when another client connects to the session. The Connection object represents the client's connection to the session. Note that this method is invoked when other clients connect to the session. When your own client client connects, the Session.SessionListener#onConnected(Session session) method is called.

Parameters:
Name Type Description
session Session The session.
connection Connection The new connection in the session.

onConnectionDestroyed(session, connection)

Invoked when another client leaves the session. The Connection object represents the client's previous connection to the session. When your own client client disconnects, the Session.SessionListener#onDisconnected(Session session) method is called.

Parameters:
Name Type Description
session Session The session.
connection Connection The connection that left the session the session.