HOME

com.ireasoning.core.network
Interface SocketServer

All Superinterfaces:
com.ireasoning.core.network.NetConst, java.io.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
 java.lang.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, java.net.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,
                 java.net.InetAddress laddr)
          throws java.io.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:
java.io.IOException

open

public void open(int port,
                 int backlogOrRecvBufSize)
          throws java.io.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:
java.io.IOException

setTimeout

public void setTimeout(int timeout)
                throws java.net.SocketException
Sets timeout value

Parameters:
timeout - time out value, in milliseconds
Throws:
java.net.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 java.io.IOException
Process request

Throws:
java.io.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 java.lang.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.