HOME

com.ireasoning.core.network
Interface SocketServer

All Superinterfaces:
com.ireasoning.core.network.NetConst, Serializable

public interface SocketServer
extends com.ireasoning.core.network.NetConst

This interface represents a socket based server program


Field Summary
 
Fields inherited from interface com.ireasoning.core.network.NetConst
TCP, UDP
 
Method Summary
 void close()
          Closes server socket
 int getActiveClientCount()
          Gets number of active clients
 MBeanServer getMBeanServer()
          Returns the MBeanServer object
 Object getServerSocket()
          Returns the server socket
 int getType()
          Returns the type of transport layer.
 void open(int port, int backlogOrRecvBufSize)
          Open a new server listening on the passed port number
 void open(int port, int backlogOrRecvBufSize, InetAddress laddr)
          Open a new server listening on the passed port number
 int process()
          Process request
 void setDataHandler(com.ireasoning.core.network.DataHandler handler)
          Sets data handler
 void setDataHandlerFactory(com.ireasoning.core.network.DataHandlerFactory handlerFactory)
          Sets data handler factory
 void setMaxConnections(int maxConns)
          Set max number of concurrent connections
 void setMBeanServer(MBeanServer server)
          Set MBeanServer object
 void setTimeout(int timeout)
          Sets timeout value
 

Method Detail

open

public void open(int port,
                 int backlogOrRecvBufSize,
                 InetAddress laddr)
          throws IOException
Open a new server listening on the passed port number

Parameters:
port - server port number
backlogOrRecvBufSize - backlog for TCP socket server, recvBufSize for UDP socket server.
laddr - - local address to bind
Throws:
IOException

open

public void open(int port,
                 int backlogOrRecvBufSize)
          throws IOException
Open a new server listening on the passed port number

Parameters:
port - server port number
backlogOrRecvBufSize - backlog for TCP socket server, recvBufSize for UDP socket server.
Throws:
IOException

setTimeout

public void setTimeout(int timeout)
                throws SocketException
Sets timeout value

Parameters:
timeout - time out value, in milliseconds
Throws:
SocketException

close

public void close()
Closes server socket


setDataHandlerFactory

public void setDataHandlerFactory(com.ireasoning.core.network.DataHandlerFactory handlerFactory)
Sets data handler factory


setDataHandler

public void setDataHandler(com.ireasoning.core.network.DataHandler handler)
Sets data handler


process

public int process()
            throws IOException
Process request

Throws:
IOException

getActiveClientCount

public int getActiveClientCount()
Gets number of active clients


setMaxConnections

public void setMaxConnections(int maxConns)
Set max number of concurrent connections


getType

public int getType()
Returns the type of transport layer.


getServerSocket

public Object getServerSocket()
Returns the server socket


setMBeanServer

public void setMBeanServer(MBeanServer server)
Set MBeanServer object


getMBeanServer

public MBeanServer getMBeanServer()
Returns the MBeanServer object


HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.