com.jme3.network
クラス Network

java.lang.Object
  上位を拡張 com.jme3.network.Network

public class Network
extends java.lang.Object

The main service provider for conveniently creating server and client instances.


フィールドの概要
static java.lang.String DEFAULT_GAME_NAME
           
static int DEFAULT_VERSION
           
 
コンストラクタの概要
Network()
           
 
メソッドの概要
static Client connectToServer(java.lang.String host, int hostPort)
          Creates a Client that communicates with the specified host and port using both reliable and fast transports.
static Client connectToServer(java.lang.String host, int hostPort, int remoteUdpPort)
          Creates a Client that communicates with the specified host and separate TCP and UDP ports using both reliable and fast transports.
static Client connectToServer(java.lang.String gameName, int version, java.lang.String host, int hostPort)
          Creates a Client that communicates with the specified host and port using both reliable and fast transports.
static Client connectToServer(java.lang.String gameName, int version, java.lang.String host, int hostPort, int remoteUdpPort)
          Creates a Client that communicates with the specified host and and separate TCP and UDP ports using both reliable and fast transports.
static NetworkClient createClient()
          Creates a client that can be connected at a later time.
static NetworkClient createClient(java.lang.String gameName, int version)
          Creates a client that can be connected at a later time.
static Server createServer(int port)
          Creates a Server that will utilize both reliable and fast transports to communicate with clients.
static Server createServer(int tcpPort, int udpPort)
          Creates a Server that will utilize both reliable and fast transports to communicate with clients.
static Server createServer(java.lang.String gameName, int version, int tcpPort, int udpPort)
          Creates a named and versioned Server that will utilize both reliable and fast transports to communicate with clients.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

DEFAULT_GAME_NAME

public static final java.lang.String DEFAULT_GAME_NAME
関連項目:
定数フィールド値

DEFAULT_VERSION

public static final int DEFAULT_VERSION
関連項目:
定数フィールド値
コンストラクタの詳細

Network

public Network()
メソッドの詳細

createServer

public static Server createServer(int port)
                           throws java.io.IOException
Creates a Server that will utilize both reliable and fast transports to communicate with clients. The specified port will be used for both TCP and UDP communication.

例外:
java.io.IOException

createServer

public static Server createServer(int tcpPort,
                                  int udpPort)
                           throws java.io.IOException
Creates a Server that will utilize both reliable and fast transports to communicate with clients. The specified port will be used for both TCP and UDP communication.

例外:
java.io.IOException

createServer

public static Server createServer(java.lang.String gameName,
                                  int version,
                                  int tcpPort,
                                  int udpPort)
                           throws java.io.IOException
Creates a named and versioned Server that will utilize both reliable and fast transports to communicate with clients. The specified port will be used for both TCP and UDP communication.

パラメータ:
gameName - This is the name that identifies the game. Connecting clients must use this name or be turned away.
version - This is a game-specific verison that helps detect when out-of-date clients have connected to an incompatible server.
tcpPort - The port upon which the TCP hosting will listen for new connections.
udpPort - The port upon which the UDP hosting will listen for new 'fast' UDP messages. Set to -1 if 'fast' traffic should go over TCP. This will comletely disable UDP traffic for this server.
例外:
java.io.IOException

createClient

public static NetworkClient createClient()
Creates a client that can be connected at a later time.


createClient

public static NetworkClient createClient(java.lang.String gameName,
                                         int version)
Creates a client that can be connected at a later time. The specified game name and version must match the server or the client will be turned away.


connectToServer

public static Client connectToServer(java.lang.String host,
                                     int hostPort)
                              throws java.io.IOException
Creates a Client that communicates with the specified host and port using both reliable and fast transports.

例外:
java.io.IOException

connectToServer

public static Client connectToServer(java.lang.String host,
                                     int hostPort,
                                     int remoteUdpPort)
                              throws java.io.IOException
Creates a Client that communicates with the specified host and separate TCP and UDP ports using both reliable and fast transports.

例外:
java.io.IOException

connectToServer

public static Client connectToServer(java.lang.String gameName,
                                     int version,
                                     java.lang.String host,
                                     int hostPort)
                              throws java.io.IOException
Creates a Client that communicates with the specified host and port using both reliable and fast transports.

例外:
java.io.IOException

connectToServer

public static Client connectToServer(java.lang.String gameName,
                                     int version,
                                     java.lang.String host,
                                     int hostPort,
                                     int remoteUdpPort)
                              throws java.io.IOException
Creates a Client that communicates with the specified host and and separate TCP and UDP ports using both reliable and fast transports.

パラメータ:
gameName - This is the name that identifies the game. This must match the target server's name or this client will be turned away.
version - This is a game-specific verison that helps detect when out-of-date clients have connected to an incompatible server. This must match the server's version of this client will be turned away.
tcpPort - The remote TCP port on the server to which this client should send reliable messages.
udpPort - 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.
例外:
java.io.IOException