com.jme3.network
インタフェース Client

すべてのスーパーインタフェース:
MessageConnection
既知のサブインタフェースの一覧:
NetworkClient
既知の実装クラスの一覧:
DefaultClient

public interface Client
extends MessageConnection

Represents a remote connection to a server that can be used for sending and receiving messages.


メソッドの概要
 void addClientStateListener(ClientStateListener listener)
          Adds a listener that will be notified about connection state changes.
 void addErrorListener(ErrorListener<? super Client> listener)
          Adds a listener that will be notified when any connection errors occur.
 void addMessageListener(MessageListener<? super Client> listener)
          Adds a listener that will be notified when any message or object is received from the server.
 void addMessageListener(MessageListener<? super Client> listener, java.lang.Class... classes)
          Adds a listener that will be notified when messages of the specified types are received.
 void close()
          Closes this connection to the server.
 java.lang.String getGameName()
          Returns the 'game name' for servers to which this client should be able to connect.
 int getId()
          Returns a unique ID for this client within the remote server or -1 if this client isn't fully connected to the server.
 int getVersion()
          Returns the game-specific version of the server this client should be able to connect to.
 boolean isConnected()
          Returns true if this client is fully connected to the host.
 void removeClientStateListener(ClientStateListener listener)
          Removes a previously registered connection listener.
 void removeErrorListener(ErrorListener<? super Client> listener)
          Removes a previously registered error listener.
 void removeMessageListener(MessageListener<? super Client> listener)
          Removes a previously registered wildcard listener.
 void removeMessageListener(MessageListener<? super Client> listener, java.lang.Class... classes)
          Removes a previously registered type-specific listener from the specified types.
 void send(Message message)
          Sends a message to the server.
 void start()
          Starts the client allowing it to begin processing incoming messages and delivering them to listeners.
 

メソッドの詳細

start

void start()
Starts the client allowing it to begin processing incoming messages and delivering them to listeners.


isConnected

boolean isConnected()
Returns true if this client is fully connected to the host.


getId

int getId()
Returns a unique ID for this client within the remote server or -1 if this client isn't fully connected to the server.


getGameName

java.lang.String getGameName()
Returns the 'game name' for servers to which this client should be able to connect. This should match the 'game name' set on the server or this client will be turned away.


getVersion

int getVersion()
Returns the game-specific version of the server this client should be able to connect to.


send

void send(Message message)
Sends a message to the server.

定義:
インタフェース MessageConnection 内の send

close

void close()
Closes this connection to the server.


addClientStateListener

void addClientStateListener(ClientStateListener listener)
Adds a listener that will be notified about connection state changes.


removeClientStateListener

void removeClientStateListener(ClientStateListener listener)
Removes a previously registered connection listener.


addMessageListener

void addMessageListener(MessageListener<? super Client> listener)
Adds a listener that will be notified when any message or object is received from the server.


addMessageListener

void addMessageListener(MessageListener<? super Client> listener,
                        java.lang.Class... classes)
Adds a listener that will be notified when messages of the specified types are received.


removeMessageListener

void removeMessageListener(MessageListener<? super Client> listener)
Removes a previously registered wildcard listener. This does not remove this listener from any type-specific registrations.


removeMessageListener

void removeMessageListener(MessageListener<? super Client> listener,
                           java.lang.Class... classes)
Removes a previously registered type-specific listener from the specified types.


addErrorListener

void addErrorListener(ErrorListener<? super Client> listener)
Adds a listener that will be notified when any connection errors occur. If a client has no error listeners then the default behavior is to close the connection and provide an appropriate DisconnectInfo to any ClientStateListeners. If the application adds its own error listeners then it must take care of closing the connection itself.


removeErrorListener

void removeErrorListener(ErrorListener<? super Client> listener)
Removes a previously registered error listener.