Package com.jme3.network
Interface NetworkClient
- All Superinterfaces:
Client
,MessageConnection
- All Known Implementing Classes:
Network.NetworkClientImpl
A Client whose network connection information can
be provided post-creation. The actual connection stack
will be setup the same as if Network.connectToServer
had been called.
-
Field Summary
Fields inherited from interface com.jme3.network.MessageConnection
CHANNEL_DEFAULT_RELIABLE, CHANNEL_DEFAULT_UNRELIABLE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
connectToServer
(String host, int port, int remoteUdpPort) Connects this client to the specified remote server and ports.void
connectToServer
(InetAddress address, int port, int remoteUdpPort) Connects this client to the specified remote server and ports.Methods inherited from interface com.jme3.network.Client
addClientStateListener, addErrorListener, addMessageListener, addMessageListener, close, getGameName, getId, getServices, getVersion, isConnected, isStarted, removeClientStateListener, removeErrorListener, removeMessageListener, removeMessageListener, send, send, start
-
Method Details
-
connectToServer
Connects this client to the specified remote server and ports.- Throws:
IOException
-
connectToServer
Connects this client to the specified remote server and ports.- 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
-