com.jme3.network.base
クラス DefaultClient

java.lang.Object
  上位を拡張 com.jme3.network.base.DefaultClient
すべての実装されたインタフェース:
Client, MessageConnection

public class DefaultClient
extends java.lang.Object
implements Client

A default implementation of the Client interface that delegates its network connectivity to a kernel.Connector.


コンストラクタの概要
DefaultClient(java.lang.String gameName, int version)
           
DefaultClient(java.lang.String gameName, int version, Connector reliable, Connector fast)
           
 
メソッドの概要
 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.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

DefaultClient

public DefaultClient(java.lang.String gameName,
                     int version)

DefaultClient

public DefaultClient(java.lang.String gameName,
                     int version,
                     Connector reliable,
                     Connector fast)
メソッドの詳細

start

public void start()
インタフェース Client の記述:
Starts the client allowing it to begin processing incoming messages and delivering them to listeners.

定義:
インタフェース Client 内の start

isConnected

public boolean isConnected()
インタフェース Client の記述:
Returns true if this client is fully connected to the host.

定義:
インタフェース Client 内の isConnected

getId

public int getId()
インタフェース Client の記述:
Returns a unique ID for this client within the remote server or -1 if this client isn't fully connected to the server.

定義:
インタフェース Client 内の getId

getGameName

public java.lang.String getGameName()
インタフェース Client の記述:
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.

定義:
インタフェース Client 内の getGameName

getVersion

public int getVersion()
インタフェース Client の記述:
Returns the game-specific version of the server this client should be able to connect to.

定義:
インタフェース Client 内の getVersion

send

public void send(Message message)
インタフェース Client の記述:
Sends a message to the server.

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

close

public void close()
インタフェース Client の記述:
Closes this connection to the server.

定義:
インタフェース Client 内の close

addClientStateListener

public void addClientStateListener(ClientStateListener listener)
インタフェース Client の記述:
Adds a listener that will be notified about connection state changes.

定義:
インタフェース Client 内の addClientStateListener

removeClientStateListener

public void removeClientStateListener(ClientStateListener listener)
インタフェース Client の記述:
Removes a previously registered connection listener.

定義:
インタフェース Client 内の removeClientStateListener

addMessageListener

public void addMessageListener(MessageListener<? super Client> listener)
インタフェース Client の記述:
Adds a listener that will be notified when any message or object is received from the server.

定義:
インタフェース Client 内の addMessageListener

addMessageListener

public void addMessageListener(MessageListener<? super Client> listener,
                               java.lang.Class... classes)
インタフェース Client の記述:
Adds a listener that will be notified when messages of the specified types are received.

定義:
インタフェース Client 内の addMessageListener

removeMessageListener

public void removeMessageListener(MessageListener<? super Client> listener)
インタフェース Client の記述:
Removes a previously registered wildcard listener. This does not remove this listener from any type-specific registrations.

定義:
インタフェース Client 内の removeMessageListener

removeMessageListener

public void removeMessageListener(MessageListener<? super Client> listener,
                                  java.lang.Class... classes)
インタフェース Client の記述:
Removes a previously registered type-specific listener from the specified types.

定義:
インタフェース Client 内の removeMessageListener

addErrorListener

public void addErrorListener(ErrorListener<? super Client> listener)
インタフェース Client の記述:
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.

定義:
インタフェース Client 内の addErrorListener

removeErrorListener

public void removeErrorListener(ErrorListener<? super Client> listener)
インタフェース Client の記述:
Removes a previously registered error listener.

定義:
インタフェース Client 内の removeErrorListener