com.jme3.network.connection
クラス Server

java.lang.Object
  上位を拡張 com.jme3.network.service.ServiceManager
      上位を拡張 com.jme3.network.connection.Server

推奨されていません。 Use Server from Network instead.

@Deprecated
public class Server
extends ServiceManager

The class where your SpiderMonkey adventures start. The server class manages the TCP and UDP servers. Using the constructors where you either provide ports or the instances, they will bind automatically. If you do not want this to happen, use the no arg constructor, and then call bind later on.


フィールドの概要
 
クラス com.jme3.network.service.ServiceManager から継承されたフィールド
CLIENT, SERVER
 
コンストラクタの概要
Server()
          推奨されていません。 Default constructor.
Server(int tcpPort, int udpPort)
          推奨されていません。 Call createServer() on Network instead.
Server(TCPConnection tcp, java.net.SocketAddress tcpAddress)
          推奨されていません。 Constructor for providing a TCP server instance.
Server(TCPConnection tcp, UDPConnection udp, java.net.SocketAddress tcpAddress, java.net.SocketAddress udpAddress)
          推奨されていません。 Constructor providing custom instances of the servers and its addresses.
Server(UDPConnection udp, java.net.SocketAddress udpAddress)
          推奨されていません。 Constructor for providing a UDP server instance.
 
メソッドの概要
 void addConnectionListener(ConnectionListener listener)
          推奨されていません。  
 void addConnectorFilter(ConnectorFilter filter)
          推奨されていません。  
 void addLocalConnectionListener(ConnectionListener listener)
          推奨されていません。  
 void addMessageListener(MessageListener listener)
          推奨されていません。  
 void addMessageListener(MessageListener listener, java.lang.Class... classes)
          推奨されていません。  
 void bind(int tcpPort, int udpPort)
          推奨されていません。 Bind method for when the no arg constructor was used.
 void broadcast(Message message)
          推奨されていません。 Broadcast a message.
 void broadcastExcept(Client except, Message message)
          推奨されていません。 Broadcast a message, except to the given client.
 Client getClientByID(int clientID)
          推奨されていません。 Get a specific client based on the provided clientID.
 java.util.List<Client> getConnectors()
          推奨されていません。 Get the combined connectors, meaning TCP and UDP are combined into one client.
 int getServerID()
          推奨されていません。  
 java.util.List<Client> getTCPConnectors()
          推奨されていません。 Get all the connectors for the TCP connection.
 java.util.List<Client> getUDPConnectors()
          推奨されていません。 Get all the connectors for the UDP connection.
 boolean isRunning()
          推奨されていません。  
 void removeConnectionListener(ConnectionListener listener)
          推奨されていません。  
 void removeConnectorFilter(ConnectorFilter filter)
          推奨されていません。  
 void removeLocalConnectionListener(ConnectionListener listener)
          推奨されていません。  
 void removeMessageListener(MessageListener listener)
          推奨されていません。  
 void removeMessageListener(MessageListener listener, java.lang.Class... classes)
          推奨されていません。  
 void setLabel(java.lang.String label)
          推奨されていません。  
 void start()
          推奨されていません。 Start this server.
 void start(int sleep)
          推奨されていません。 Start this server with given sleep time.
 void stop()
          推奨されていません。 Stop this server.
 void stop(DisconnectMessage message)
          推奨されていません。 Stops the server with custom message.
 java.lang.String toString()
          推奨されていません。  
 
クラス com.jme3.network.service.ServiceManager から継承されたメソッド
getService
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Server

public Server()
推奨されていません。 
Default constructor. Sets the label to Server#[serverID]


Server

public Server(TCPConnection tcp,
              UDPConnection udp,
              java.net.SocketAddress tcpAddress,
              java.net.SocketAddress udpAddress)
       throws java.io.IOException
推奨されていません。 
Constructor providing custom instances of the servers and its addresses.

パラメータ:
tcp - The TCPConnection instance to manage.
udp - The UDPConnection instance to manage.
tcpAddress - The TCP address to bind to.
udpAddress - The UDP address to bind to.
例外:
java.io.IOException - When a bind error has occurred.

Server

public Server(TCPConnection tcp,
              java.net.SocketAddress tcpAddress)
       throws java.io.IOException
推奨されていません。 
Constructor for providing a TCP server instance. UDP will be disabled.

パラメータ:
tcp - The TCPConnection instance.
tcpAddress - The address to bind to.
例外:
java.io.IOException - When a binding error occurs.

Server

public Server(UDPConnection udp,
              java.net.SocketAddress udpAddress)
       throws java.io.IOException
推奨されていません。 
Constructor for providing a UDP server instance. TCP will be disabled.

パラメータ:
udp - The UDP server instance.
udpAddress - The address to bind to.
例外:
java.io.IOException - When a binding error occurs.

Server

@Deprecated
public Server(int tcpPort,
                         int udpPort)
       throws java.io.IOException
推奨されていません。 Call createServer() on Network instead.

Simple constructor for providing TCP port and UDP port. Will bind using on all interfaces, on given ports.

パラメータ:
tcpPort - The TCP port to use.
udpPort - The UDP port to use.
例外:
java.io.IOException - When a binding error occurs.
メソッドの詳細

bind

public void bind(int tcpPort,
                 int udpPort)
          throws java.lang.IllegalArgumentException,
                 java.io.IOException
推奨されていません。 
Bind method for when the no arg constructor was used.

パラメータ:
tcpPort - The TCP port to use. To turn off, use -1.
udpPort - The UDP port to use. To turn off, use -1.
例外:
java.lang.IllegalArgumentException - When an illegal argument was given.
java.io.IOException - When a binding error occurs.

broadcast

public void broadcast(Message message)
               throws java.io.IOException
推奨されていません。 
Broadcast a message.

パラメータ:
message - The message to broadcast.
例外:
java.io.IOException - When a writing error occurs.

broadcastExcept

public void broadcastExcept(Client except,
                            Message message)
                     throws java.io.IOException
推奨されていません。 
Broadcast a message, except to the given client.

パラメータ:
except - The client to refrain from sending the message to.
message - The message to send.
例外:
java.io.IOException - When a writing error occurs.

start

public void start()
           throws java.io.IOException
推奨されていません。 
Start this server.

例外:
java.io.IOException - When an error occurs.

start

public void start(int sleep)
           throws java.io.IOException
推奨されていません。 
Start this server with given sleep time. Higher sleep times may affect the system's response time negatively, whereas lower values may increase CPU load. Use only when you're certain.

パラメータ:
sleep - The sleep time.
例外:
java.io.IOException - When an error occurs.

stop

public void stop()
          throws java.io.IOException
推奨されていません。 
Stop this server. Note that it kicks all clients so that they can gracefully quit.

例外:
java.io.IOException - When a writing error occurs.

stop

public void stop(DisconnectMessage message)
          throws java.io.IOException
推奨されていません。 
Stops the server with custom message.

例外:
java.io.IOException - When a writing error occurs.

isRunning

public boolean isRunning()
推奨されていません。 

getServerID

public int getServerID()
推奨されていません。 

setLabel

public void setLabel(java.lang.String label)
推奨されていません。 

toString

public java.lang.String toString()
推奨されていません。 
オーバーライド:
クラス java.lang.Object 内の toString

getTCPConnectors

public java.util.List<Client> getTCPConnectors()
推奨されていません。 
Get all the connectors for the TCP connection.

戻り値:
A unmodifiable list with the connectors.

getUDPConnectors

public java.util.List<Client> getUDPConnectors()
推奨されていません。 
Get all the connectors for the UDP connection.

戻り値:
A unmodifiable list with the connectors.

getConnectors

public java.util.List<Client> getConnectors()
推奨されていません。 
Get the combined connectors, meaning TCP and UDP are combined into one client. You should generally use this for clients.

戻り値:
A unmodifiable list with the connectors.

getClientByID

public Client getClientByID(int clientID)
推奨されていません。 
Get a specific client based on the provided clientID.

パラメータ:
clientID - The clientID identifying the client requested.
戻り値:
The located client or null if the client was not on the list.

addConnectorFilter

public void addConnectorFilter(ConnectorFilter filter)
推奨されていません。 

removeConnectorFilter

public void removeConnectorFilter(ConnectorFilter filter)
推奨されていません。 

addLocalConnectionListener

public void addLocalConnectionListener(ConnectionListener listener)
推奨されていません。 

removeLocalConnectionListener

public void removeLocalConnectionListener(ConnectionListener listener)
推奨されていません。 

addConnectionListener

public void addConnectionListener(ConnectionListener listener)
推奨されていません。 

removeConnectionListener

public void removeConnectionListener(ConnectionListener listener)
推奨されていません。 

addMessageListener

public void addMessageListener(MessageListener listener)
推奨されていません。 

addMessageListener

public void addMessageListener(MessageListener listener,
                               java.lang.Class... classes)
推奨されていません。 

removeMessageListener

public void removeMessageListener(MessageListener listener)
推奨されていません。 

removeMessageListener

public void removeMessageListener(MessageListener listener,
                                  java.lang.Class... classes)
推奨されていません。