Class Network.NetworkClientImpl
java.lang.Object
com.jme3.network.base.DefaultClient
com.jme3.network.Network.NetworkClientImpl
- All Implemented Interfaces:
Client, MessageConnection, NetworkClient
- Enclosing class:
Network
Client implementation used by the convenience factory methods.
- Author:
- Paul Speed
-
Nested Class Summary
Nested classes/interfaces inherited from class DefaultClient
DefaultClient.Redispatch -
Field Summary
Fields inherited from interface MessageConnection
CHANNEL_DEFAULT_RELIABLE, CHANNEL_DEFAULT_UNRELIABLE -
Constructor Summary
ConstructorsConstructorDescriptionNetworkClientImpl(String gameName, int version) Creates a network client implementation. -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectToServer(String host, int port, int remoteUdpPort) Connects this client to the specified remote server and ports.voidconnectToServer(InetAddress address, int port, int remoteUdpPort) Connects this client to the specified remote server and ports.Methods inherited from class DefaultClient
addClientStateListener, addErrorListener, addMessageListener, addMessageListener, addStandardServices, checkRunning, close, closeConnections, configureChannels, dispatch, fireConnected, fireDisconnected, getGameName, getId, getServices, getVersion, handleError, isConnected, isStarted, removeClientStateListener, removeErrorListener, removeMessageListener, removeMessageListener, send, send, send, setPrimaryConnectors, start, startServices, waitForConnectedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Client
addClientStateListener, addErrorListener, addMessageListener, addMessageListener, close, getGameName, getId, getServices, getVersion, isConnected, isStarted, removeClientStateListener, removeErrorListener, removeMessageListener, removeMessageListener, send, send, start
-
Constructor Details
-
NetworkClientImpl
Creates a network client implementation.- Parameters:
gameName- the expected game nameversion- the expected protocol version
-
-
Method Details
-
connectToServer
Description copied from interface:NetworkClientConnects this client to the specified remote server and ports.- Specified by:
connectToServerin interfaceNetworkClient- Parameters:
host- the remote host name or addressport- the remote TCP portremoteUdpPort- the remote UDP port- Throws:
IOException- if the client cannot connect
-
connectToServer
Description copied from interface:NetworkClientConnects this client to the specified remote server and ports.- Specified by:
connectToServerin interfaceNetworkClient- Parameters:
address- The host's Internet address.port- The remote TCP port on the server to which this client should send reliable messages.remoteUdpPort- The remote UDP port on the server to which this client should send 'fast'/unreliable messages. Set to -1 if 'fast' traffic should go over TCP. This will completely disable UDP traffic for this client.- Throws:
IOException- if the client cannot connect
-