Package com.jme3.network.base
Class DefaultServer.Connection
java.lang.Object
com.jme3.network.base.DefaultServer.Connection
- All Implemented Interfaces:
HostedConnection
,MessageConnection
- Enclosing class:
- DefaultServer
-
Field Summary
Fields inherited from interface com.jme3.network.MessageConnection
CHANNEL_DEFAULT_RELIABLE, CHANNEL_DEFAULT_UNRELIABLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a read-only set of attribute names currently stored for this client session.void
Closes and removes this connection from the server sending the optional reason to the remote client.protected void
Returns the transport specific remote address of this connection as a string.<T> T
getAttribute
(String name) Retrieves a previously stored session attribute or null if no such attribute exists.int
getId()
Returns the server-unique ID for this client.Returns the Server instance that is hosting this connection.void
Sends a message to the other end of the connection using the specified alternate channel.void
Sends a message to the other end of the connection.setAttribute
(String name, Object value) Sets a session attribute specific to this connection.toString()
-
Constructor Details
-
Connection
public Connection(int channelCount)
-
-
Method Details
-
getServer
Description copied from interface:HostedConnection
Returns the Server instance that is hosting this connection.- Specified by:
getServer
in interfaceHostedConnection
-
getId
public int getId()Description copied from interface:HostedConnection
Returns the server-unique ID for this client.- Specified by:
getId
in interfaceHostedConnection
-
getAddress
Description copied from interface:HostedConnection
Returns the transport specific remote address of this connection as a string. This may or may not be unique per connection depending on the type of transport. It is provided for information and filtering purposes.- Specified by:
getAddress
in interfaceHostedConnection
-
send
Description copied from interface:MessageConnection
Sends a message to the other end of the connection.- Specified by:
send
in interfaceMessageConnection
-
send
Description copied from interface:MessageConnection
Sends a message to the other end of the connection using the specified alternate channel.- Specified by:
send
in interfaceMessageConnection
-
closeConnection
protected void closeConnection() -
close
Description copied from interface:HostedConnection
Closes and removes this connection from the server sending the optional reason to the remote client.- Specified by:
close
in interfaceHostedConnection
-
setAttribute
Description copied from interface:HostedConnection
Sets a session attribute specific to this connection. If the value is set to null then the attribute is removed.- Specified by:
setAttribute
in interfaceHostedConnection
- Returns:
- The previous session value for this key or null if there was no previous value.
-
getAttribute
Description copied from interface:HostedConnection
Retrieves a previously stored session attribute or null if no such attribute exists.- Specified by:
getAttribute
in interfaceHostedConnection
-
attributeNames
Description copied from interface:HostedConnection
Returns a read-only set of attribute names currently stored for this client session.- Specified by:
attributeNames
in interfaceHostedConnection
-
toString
-