Package org.ngengine.network
Class RemotePeer
java.lang.Object
org.ngengine.network.RemotePeer
- All Implemented Interfaces:
HostedConnection
,MessageConnection
-
Field Summary
Fields inherited from interface com.jme3.network.MessageConnection
CHANNEL_DEFAULT_RELIABLE, CHANNEL_DEFAULT_UNRELIABLE
-
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.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.org.ngengine.nostr4j.rtc.NostrRTCSocket
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.
-
Method Details
-
getSocket
public org.ngengine.nostr4j.rtc.NostrRTCSocket getSocket() -
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
-
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
-
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
-