protected class DefaultServer.Connection extends java.lang.Object implements HostedConnection
CHANNEL_DEFAULT_RELIABLE, CHANNEL_DEFAULT_UNRELIABLE| Constructor and Description |
|---|
Connection(int channelCount) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.lang.String> |
attributeNames()
Returns a read-only set of attribute names currently stored
for this client session.
|
void |
close(java.lang.String reason)
Closes and removes this connection from the server
sending the optional reason to the remote client.
|
protected void |
closeConnection() |
java.lang.String |
getAddress()
Returns the transport specific remote address of this connection
as a string.
|
<T> T |
getAttribute(java.lang.String name)
Retrieves a previosly stored session attribute or
null if no such attribute exists.
|
int |
getId()
Returns the server-unique ID for this client.
|
Server |
getServer()
Returns the Server instance that is hosting this connection.
|
void |
send(int channel,
Message message)
Sends a message to the other end of the connection using
the specified alternate channel.
|
void |
send(Message message)
Sends a message to the other end of the connection.
|
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets a session attribute specific to this connection.
|
java.lang.String |
toString() |
public Server getServer()
HostedConnectiongetServer in interface HostedConnectionpublic int getId()
HostedConnectiongetId in interface HostedConnectionpublic java.lang.String getAddress()
HostedConnectiongetAddress in interface HostedConnectionpublic void send(Message message)
MessageConnectionsend in interface MessageConnectionpublic void send(int channel,
Message message)
MessageConnectionsend in interface MessageConnectionprotected void closeConnection()
public void close(java.lang.String reason)
HostedConnectionclose in interface HostedConnectionpublic java.lang.Object setAttribute(java.lang.String name,
java.lang.Object value)
HostedConnectionsetAttribute in interface HostedConnectionpublic <T> T getAttribute(java.lang.String name)
HostedConnectiongetAttribute in interface HostedConnectionpublic java.util.Set<java.lang.String> attributeNames()
HostedConnectionattributeNames in interface HostedConnectionpublic java.lang.String toString()
toString in class java.lang.Object