com.jme3.network
Interface HostedConnection

All Superinterfaces:
MessageConnection
All Known Implementing Classes:
DefaultServer.Connection

public interface HostedConnection
extends MessageConnection

This is the connection back to a client that is being hosted in a server instance.


Method Summary
 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.
 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.
 java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
          Sets a session attribute specific to this connection.
 
Methods inherited from interface com.jme3.network.MessageConnection
send, send
 

Method Detail

getServer

Server getServer()
Returns the Server instance that is hosting this connection.


getId

int getId()
Returns the server-unique ID for this client.


getAddress

java.lang.String getAddress()
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.


close

void close(java.lang.String reason)
Closes and removes this connection from the server sending the optional reason to the remote client.


setAttribute

java.lang.Object setAttribute(java.lang.String name,
                              java.lang.Object value)
Sets a session attribute specific to this connection. If the value is set to null then the attribute is removed.

Returns:
The previous session value for this key or null if there was no previous value.

getAttribute

<T> T getAttribute(java.lang.String name)
Retrieves a previosly stored session attribute or null if no such attribute exists.


attributeNames

java.util.Set<java.lang.String> attributeNames()
Returns a read-only set of attribute names currently stored for this client session.