Class DefaultServer.Connection

java.lang.Object
com.jme3.network.base.DefaultServer.Connection
All Implemented Interfaces:
HostedConnection, MessageConnection
Enclosing class:
DefaultServer

protected class DefaultServer.Connection extends Object implements HostedConnection
  • Constructor Details

    • Connection

      public Connection(int channelCount)
  • Method Details

    • getServer

      public Server getServer()
      Description copied from interface: HostedConnection
      Returns the Server instance that is hosting this connection.
      Specified by:
      getServer in interface HostedConnection
    • getId

      public int getId()
      Description copied from interface: HostedConnection
      Returns the server-unique ID for this client.
      Specified by:
      getId in interface HostedConnection
    • getAddress

      public String 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 interface HostedConnection
    • send

      public void send(Message message)
      Description copied from interface: MessageConnection
      Sends a message to the other end of the connection.
      Specified by:
      send in interface MessageConnection
    • send

      public void send(int channel, Message message)
      Description copied from interface: MessageConnection
      Sends a message to the other end of the connection using the specified alternate channel.
      Specified by:
      send in interface MessageConnection
    • closeConnection

      protected void closeConnection()
    • close

      public void close(String reason)
      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 interface HostedConnection
    • setAttribute

      public Object setAttribute(String name, Object value)
      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 interface HostedConnection
      Returns:
      The previous session value for this key or null if there was no previous value.
    • getAttribute

      public <T> T getAttribute(String name)
      Description copied from interface: HostedConnection
      Retrieves a previously stored session attribute or null if no such attribute exists.
      Specified by:
      getAttribute in interface HostedConnection
    • attributeNames

      public Set<String> attributeNames()
      Description copied from interface: HostedConnection
      Returns a read-only set of attribute names currently stored for this client session.
      Specified by:
      attributeNames in interface HostedConnection
    • toString

      public String toString()
      Overrides:
      toString in class Object