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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a read-only set of attribute names currently stored for this client session.voidCloses and removes this connection from the server sending the optional reason to the remote client.protected voidReturns the transport specific remote address of this connection as a string.<T> TgetAttribute(String name) Retrieves a previously stored session attribute or null if no such attribute exists.intgetId()Returns the server-unique ID for this client.Returns the Server instance that is hosting this connection.voidSends a message to the other end of the connection using the specified alternate channel.voidSends 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:HostedConnectionReturns the Server instance that is hosting this connection.- Specified by:
getServerin interfaceHostedConnection
-
getId
public int getId()Description copied from interface:HostedConnectionReturns the server-unique ID for this client.- Specified by:
getIdin interfaceHostedConnection
-
getAddress
Description copied from interface:HostedConnectionReturns 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:
getAddressin interfaceHostedConnection
-
send
Description copied from interface:MessageConnectionSends a message to the other end of the connection.- Specified by:
sendin interfaceMessageConnection
-
send
Description copied from interface:MessageConnectionSends a message to the other end of the connection using the specified alternate channel.- Specified by:
sendin interfaceMessageConnection
-
closeConnection
protected void closeConnection() -
close
Description copied from interface:HostedConnectionCloses and removes this connection from the server sending the optional reason to the remote client.- Specified by:
closein interfaceHostedConnection
-
setAttribute
Description copied from interface:HostedConnectionSets a session attribute specific to this connection. If the value is set to null then the attribute is removed.- Specified by:
setAttributein interfaceHostedConnection- Returns:
- The previous session value for this key or null if there was no previous value.
-
getAttribute
Description copied from interface:HostedConnectionRetrieves a previously stored session attribute or null if no such attribute exists.- Specified by:
getAttributein interfaceHostedConnection
-
attributeNames
Description copied from interface:HostedConnectionReturns a read-only set of attribute names currently stored for this client session.- Specified by:
attributeNamesin interfaceHostedConnection
-
toString
-