org.xsocket.stream
Class MultithreadedServer

Package class diagram package MultithreadedServer
java.lang.Object
  extended by org.xsocket.stream.MultithreadedServer
All Implemented Interfaces:
java.io.Closeable, java.lang.Runnable, IMultithreadedServer

public final class MultithreadedServer
extends java.lang.Object
implements IMultithreadedServer

Implementation of a multithreaded server. For more information see IMultithreadedServer


Field Summary
 
Fields inherited from interface org.xsocket.stream.IMultithreadedServer
DEFAULT_CONNECTION_TIMEOUT_SEC, DEFAULT_IDLE_TIMEOUT_SEC, DEFAULT_RECEIVE_BUFFER_PREALLOCATION_SIZE, SO_RCVBUF, SO_REUSEADDR
 
Constructor Summary
MultithreadedServer(IHandler handler)
          constructor

The idle- and connection time out will be set with the default values.
MultithreadedServer(IHandler handler, java.util.concurrent.Executor workerpool)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(java.net.InetAddress address, int port, IHandler handler)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(java.net.InetAddress address, int port, IHandler handler, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(java.net.InetAddress address, int port, IHandler handler, java.util.concurrent.Executor workerPool)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(java.net.InetAddress address, int port, java.util.Map<java.lang.String,java.lang.Object> options, IHandler handler, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(java.net.InetAddress address, int port, java.util.Map<java.lang.String,java.lang.Object> options, IHandler appHandler, java.util.concurrent.Executor workerpool, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          constructor

For idle-, connection time out see MultithreadedServer(IHandler)
MultithreadedServer(java.net.InetAddress address, int port, StreamSocketConfiguration socketConfiguration, IHandler handler)
          Deprecated.  
MultithreadedServer(java.net.InetAddress address, int port, StreamSocketConfiguration socketConfiguration, IHandler handler, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          Deprecated.  
MultithreadedServer(java.net.InetAddress address, int port, StreamSocketConfiguration socketConfiguration, IHandler appHandler, java.util.concurrent.Executor workerpool, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          Deprecated.  
MultithreadedServer(int port, IHandler handler)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(int port, IHandler handler, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(int port, IHandler handler, java.util.concurrent.Executor workerpool)
          constructor

For idle-, connection time out see MultithreadedServer(IHandler)
MultithreadedServer(int port, java.util.Map<java.lang.String,java.lang.Object> options, IHandler handler)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(int port, java.util.Map<java.lang.String,java.lang.Object> options, IHandler handler, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(int port, StreamSocketConfiguration socketConfiguration, IHandler handler)
          Deprecated.  
MultithreadedServer(int port, StreamSocketConfiguration socketConfiguration, IHandler handler, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          Deprecated.  
MultithreadedServer(java.util.Map<java.lang.String,java.lang.Object> options, IHandler handler)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(StreamSocketConfiguration socketConfiguration, IHandler handler)
          Deprecated.  
MultithreadedServer(java.lang.String ipAddress, int port, IHandler handler)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(java.lang.String ipAddress, int port, IHandler handler, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(java.lang.String ipAddress, int port, java.util.Map<java.lang.String,java.lang.Object> options, IHandler handler)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(java.lang.String ipAddress, int port, java.util.Map<java.lang.String,java.lang.Object> options, IHandler handler, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)
MultithreadedServer(java.lang.String ipAddress, int port, StreamSocketConfiguration socketConfiguration, IHandler handler)
          Deprecated.  
MultithreadedServer(java.lang.String ipAddress, int port, StreamSocketConfiguration socketConfiguration, IHandler handler, boolean sslOn, javax.net.ssl.SSLContext sslContext)
          Deprecated.  
 
Method Summary
 void addListener(IMutlithreadedServerListener listener)
          adds a listener
 void close()
          
 int getConnectionTimeoutSec()
          gets the connection timeout
 int getDispatcherPoolSize()
          Deprecated.  
 int getIdleTimeoutSec()
          returns the idle timeout in sec.
 java.net.InetAddress getLocalAddress()
          get the local address
 int getLocalPort()
          get the server port
 java.lang.Object getOption(java.lang.String name)
          returns the vlaue of a option
 java.util.Map<java.lang.String,java.lang.Class> getOptions()
          Returns an unmodifiable map of the options supported by this endpont.
 int getReceiveBufferPreallocationSize()
          Deprecated. no replacement
 java.util.concurrent.Executor getWorkerpool()
          return the worker pool
 IWorkerPool getWorkerPool()
          Deprecated. use IMultithreadedServer.getWorkerpool() instead
 boolean isOpen()
          signals, if service is running
 boolean removeListener(IMutlithreadedServerListener listener)
          removes a listener
 void run()
          
 void setConnectionTimeoutSec(int timeoutSec)
          sets the max time for a connections.
 void setDispatcherPoolSize(int size)
          Deprecated.  
 void setHandler(IHandler appHandler)
          set the handler.
 void setIdleTimeoutSec(int timeoutSec)
          sets the idle timeout in sec
 void setReceiveBufferPreallocationSize(int size)
          Deprecated. use System.property instead. see IoProvider
 void setWorkerPool(IWorkerPool newWorkerPool)
          Deprecated.  
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultithreadedServer

public MultithreadedServer(IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

The idle- and connection time out will be set with the default values. To perform the worker threads a FixedThreadPool Executors.newFixedThreadPool(int) with 250 max threads will be created.

Parameters:
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
Throws:
java.io.IOException - If some other I/O error occurs
java.net.UnknownHostException - if the locale host cannot determined

MultithreadedServer

public MultithreadedServer(IHandler handler,
                           java.util.concurrent.Executor workerpool)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
workerpool - the workerpool to use. By setting the WorkerPool with null the worker pool will be deactivated. The callback handler will be executed by the main dispatching thread. If the handler performs blocking operations, the disptaching will also be blocked!
Throws:
java.io.IOException - If some other I/O error occurs
java.net.UnknownHostException - if the locale host cannot determined

MultithreadedServer

public MultithreadedServer(StreamSocketConfiguration socketConfiguration,
                           IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
Deprecated. 

Throws:
java.net.UnknownHostException
java.io.IOException

MultithreadedServer

public MultithreadedServer(java.util.Map<java.lang.String,java.lang.Object> options,
                           IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
options - the socket options
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
Throws:
java.io.IOException - If some other I/O error occurs
java.net.UnknownHostException - if the locale host cannot determined

MultithreadedServer

public MultithreadedServer(int port,
                           IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
port - the local port
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(int port,
                           IHandler handler,
                           java.util.concurrent.Executor workerpool)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out see MultithreadedServer(IHandler)

Parameters:
port - the local port
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
workerpool - the workerpool to use. By setting the WorkerPool with null the worker pool will be deactivated. The callback handler will be executed by the main dispatching thread. If the handler performs blocking operations, the disptaching will also be blocked!
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(int port,
                           StreamSocketConfiguration socketConfiguration,
                           IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
Deprecated. 

Throws:
java.net.UnknownHostException
java.io.IOException

MultithreadedServer

public MultithreadedServer(int port,
                           java.util.Map<java.lang.String,java.lang.Object> options,
                           IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
port - the local port
options - the acceptor socket options
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(java.net.InetAddress address,
                           int port,
                           IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
address - the local address
port - the local port
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(java.net.InetAddress address,
                           int port,
                           IHandler handler,
                           java.util.concurrent.Executor workerPool)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
address - the local address
port - the local port
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
workerPool - the workerpool
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(java.net.InetAddress address,
                           int port,
                           StreamSocketConfiguration socketConfiguration,
                           IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
Deprecated. 

Throws:
java.net.UnknownHostException
java.io.IOException

MultithreadedServer

public MultithreadedServer(java.lang.String ipAddress,
                           int port,
                           IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
ipAddress - the local ip address
port - the local port
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(java.lang.String ipAddress,
                           int port,
                           StreamSocketConfiguration socketConfiguration,
                           IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
Deprecated. 

Throws:
java.net.UnknownHostException
java.io.IOException

MultithreadedServer

public MultithreadedServer(java.lang.String ipAddress,
                           int port,
                           java.util.Map<java.lang.String,java.lang.Object> options,
                           IHandler handler)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
ipAddress - the local ip address
port - the local port
options - the socket options
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(int port,
                           IHandler handler,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
port - local port
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
sslOn - true, is SSL should be activated
sslContext - the ssl context to use
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(int port,
                           StreamSocketConfiguration socketConfiguration,
                           IHandler handler,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
Deprecated. 

Throws:
java.net.UnknownHostException
java.io.IOException

MultithreadedServer

public MultithreadedServer(int port,
                           java.util.Map<java.lang.String,java.lang.Object> options,
                           IHandler handler,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
port - local port
options - the acceptor socket options
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IHandlerLifeCycleListener)
sslOn - true, is SSL should be activated
sslContext - the ssl context to use
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(java.lang.String ipAddress,
                           int port,
                           IHandler handler,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
ipAddress - local ip address
port - local port
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IConnectionScoped, IHandlerLifeCycleListener)
sslOn - true, is SSL should be activated
sslContext - the ssl context to use
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(java.lang.String ipAddress,
                           int port,
                           StreamSocketConfiguration socketConfiguration,
                           IHandler handler,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
Deprecated. 

Throws:
java.net.UnknownHostException
java.io.IOException

MultithreadedServer

public MultithreadedServer(java.lang.String ipAddress,
                           int port,
                           java.util.Map<java.lang.String,java.lang.Object> options,
                           IHandler handler,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
ipAddress - local ip address
port - local port
options - the acceptor socket options
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IConnectionScoped, IHandlerLifeCycleListener)
sslOn - true, is SSL should be activated
sslContext - the ssl context to use
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(java.net.InetAddress address,
                           int port,
                           IHandler handler,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
address - local address
port - local port
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IConnectionScoped, IHandlerLifeCycleListener)
sslOn - true, is SSL should be activated
sslContext - the ssl context to use
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(java.net.InetAddress address,
                           int port,
                           StreamSocketConfiguration socketConfiguration,
                           IHandler handler,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
Deprecated. 

Throws:
java.net.UnknownHostException
java.io.IOException

MultithreadedServer

public MultithreadedServer(java.net.InetAddress address,
                           int port,
                           java.util.Map<java.lang.String,java.lang.Object> options,
                           IHandler handler,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out and the used workerpool see MultithreadedServer(IHandler)

Parameters:
address - local address
port - local port
options - the socket options
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IConnectionScoped, IHandlerLifeCycleListener)
sslOn - true, is SSL should be activated
sslContext - the ssl context to use
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs

MultithreadedServer

public MultithreadedServer(java.net.InetAddress address,
                           int port,
                           StreamSocketConfiguration socketConfiguration,
                           IHandler appHandler,
                           java.util.concurrent.Executor workerpool,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
Deprecated. 

Throws:
java.net.UnknownHostException
java.io.IOException

MultithreadedServer

public MultithreadedServer(java.net.InetAddress address,
                           int port,
                           java.util.Map<java.lang.String,java.lang.Object> options,
                           IHandler appHandler,
                           java.util.concurrent.Executor workerpool,
                           boolean sslOn,
                           javax.net.ssl.SSLContext sslContext)
                    throws java.net.UnknownHostException,
                           java.io.IOException
constructor

For idle-, connection time out see MultithreadedServer(IHandler)

Parameters:
address - local address
port - local port
options - the acceptor socket options
handler - the handler to use (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IConnectionScoped, IHandlerLifeCycleListener)
workerpool - the workerpool to use
sslOn - true, is SSL should be activated
sslContext - the ssl context to use
Throws:
java.net.UnknownHostException - if the locale host cannot determined
java.io.IOException - If some other I/O error occurs
Method Detail

run

public final void run()

Specified by:
run in interface java.lang.Runnable

getOption

public java.lang.Object getOption(java.lang.String name)
                           throws java.io.IOException
returns the vlaue of a option

Specified by:
getOption in interface IMultithreadedServer
Parameters:
name - the name of the option
Returns:
the value of the option
Throws:
java.io.IOException - In an I/O error occurs

getOptions

public java.util.Map<java.lang.String,java.lang.Class> getOptions()
Returns an unmodifiable map of the options supported by this endpont. The key in the returned map is the name of a option, and its value is the type of the option value. The returned map will never contain null keys or values.

Specified by:
getOptions in interface IMultithreadedServer
Returns:
An unmodifiable map of the options supported by this channel

close

public void close()

Specified by:
close in interface java.io.Closeable

addListener

public void addListener(IMutlithreadedServerListener listener)
adds a listener

Specified by:
addListener in interface IMultithreadedServer
Parameters:
listener - gthe listener to add

removeListener

public boolean removeListener(IMutlithreadedServerListener listener)
removes a listener

Specified by:
removeListener in interface IMultithreadedServer
Parameters:
listener - the listener to remove
Returns:
true, is the listener has been removed

getWorkerPool

public IWorkerPool getWorkerPool()
Deprecated. use IMultithreadedServer.getWorkerpool() instead

return the worker pool

Specified by:
getWorkerPool in interface IMultithreadedServer
Returns:
the worker pool

getWorkerpool

public java.util.concurrent.Executor getWorkerpool()
return the worker pool

Specified by:
getWorkerpool in interface IMultithreadedServer
Returns:
the worker pool

setWorkerPool

public void setWorkerPool(IWorkerPool newWorkerPool)
Deprecated. 

replace the worker pool with the given one. By setting the WorkerPool with null the worker pool will be deactivated. The callback handler will be executed by the main dispatching thread. If the handler performs blocking operations, the disptaching will also be blocked!

By closing the endpoint, the close method of the worker pool will be called

Specified by:
setWorkerPool in interface IMultithreadedServer
Parameters:
newWorkerPool - the worker pool to set or null to deactivate the worker pool

setDispatcherPoolSize

public final void setDispatcherPoolSize(int size)
Deprecated. 

set the dispatcher pool size

Specified by:
setDispatcherPoolSize in interface IMultithreadedServer
Parameters:
size - the dispatcher pool size

getDispatcherPoolSize

public int getDispatcherPoolSize()
Deprecated. 

get the dispatcher pool size

Specified by:
getDispatcherPoolSize in interface IMultithreadedServer
Returns:
the dispatcher pool size

isOpen

public boolean isOpen()
signals, if service is running

Specified by:
isOpen in interface IMultithreadedServer
Returns:
true, if the server is running

setHandler

public void setHandler(IHandler appHandler)
set the handler. The server performs the initialzation of the given handler immediately.

Specified by:
setHandler in interface IMultithreadedServer
Parameters:
appHandler - the handler. (supported: IConnectHandler, IDisconnectHandler, IDataHandler, ITimeoutHandler, IConnectionScoped, ILifeCycle)

getLocalPort

public final int getLocalPort()
get the server port

Specified by:
getLocalPort in interface IMultithreadedServer
Returns:
the server port

getLocalAddress

public final java.net.InetAddress getLocalAddress()
get the local address

Specified by:
getLocalAddress in interface IMultithreadedServer
Returns:
the local address

getReceiveBufferPreallocationSize

public final int getReceiveBufferPreallocationSize()
Deprecated. no replacement

get the size of the preallocation buffer, for reading incomming data

Specified by:
getReceiveBufferPreallocationSize in interface IMultithreadedServer
Returns:
preallocation buffer size

setReceiveBufferPreallocationSize

public void setReceiveBufferPreallocationSize(int size)
Deprecated. use System.property instead. see IoProvider

set the size of the preallocation buffer, for reading incomming data

Specified by:
setReceiveBufferPreallocationSize in interface IMultithreadedServer
Parameters:
size - preallocation buffer size

setConnectionTimeoutSec

public void setConnectionTimeoutSec(int timeoutSec)
sets the max time for a connections. By exceeding this time the connection will be terminated

Specified by:
setConnectionTimeoutSec in interface IMultithreadedServer
Parameters:
timeoutSec - the connection timeout in sec

setIdleTimeoutSec

public void setIdleTimeoutSec(int timeoutSec)
sets the idle timeout in sec

Specified by:
setIdleTimeoutSec in interface IMultithreadedServer
Parameters:
timeoutSec - idle timeout in sec

getConnectionTimeoutSec

public int getConnectionTimeoutSec()
gets the connection timeout

Specified by:
getConnectionTimeoutSec in interface IMultithreadedServer
Returns:
connection timeout

getIdleTimeoutSec

public int getIdleTimeoutSec()
returns the idle timeout in sec.

Specified by:
getIdleTimeoutSec in interface IMultithreadedServer
Returns:
idle timeout in sec