public class Server
extends java.lang.Object
implements java.lang.Runnable
Runnable
that can be issued to any thread to run the server.Constructor and Description |
---|
Server(int port,
CommandHandler commandHandler)
Creates a server that will run on the given port
|
Modifier and Type | Method and Description |
---|---|
int |
getClientSocketTimeout()
Returns the client timeout for socket connections in milliseconds
|
java.lang.String |
getVersion()
Returns the server version
|
void |
run() |
void |
setClientSocketTimeout(int clientSocketTimeout)
Sets the client timeout for socket connections in milliseconds.
|
void |
setVersion(java.lang.String version)
Sets the version of the server.
|
public Server(int port, CommandHandler commandHandler)
port
- The port that the server will listen oncommandHandler
- The handler of commands to usepublic void run()
run
in interface java.lang.Runnable
public int getClientSocketTimeout()
public void setClientSocketTimeout(int clientSocketTimeout)
DEFAULT_CLIENT_SOCKET_TIMEOUT
clientSocketTimeout
- public java.lang.String getVersion()
public void setVersion(java.lang.String version)
version
- A user defined version string.