org.resoa.stack.kernel
Interface TCPGateway

All Known Implementing Classes:
NetTCPGateway, NIOTCPGateway

public interface TCPGateway


Method Summary
 int activeSessions()
          Returns the currently cached sessions
 void close(org.resoa.stack.config.HostStatus state, java.lang.String infoMsg)
          Disconnect from all connections
 void connectToRemote(Session session)
          Connect to an address
 void disconnect()
          Disconnect all sessions
 void disconnect(Session session)
          Disconnect from an address
 void init(Stack stack, int localHostIndex)
          Initializes the gateway
 void onAccept(Session session)
          Invoked after successful socket accept
 void onInitialized(Session session)
          Invoked after successful session connect handshake
 void pingSessions()
          Sends a PING ProtocolService message to all registered sessions
 void send(org.resoa.grid.Message msg)
          Sends a message to remote
 void setConnectionAccept(boolean accept)
          Allow or stops the connection accept.
 

Method Detail

send

void send(org.resoa.grid.Message msg)
          throws java.io.IOException,
                 org.resoa.exception.ProtocolException
Sends a message to remote

Parameters:
msg - the message to send
Throws:
org.resoa.exception.ProtocolException
java.io.IOException

connectToRemote

void connectToRemote(Session session)
                     throws java.io.IOException
Connect to an address

Parameters:
session -
Throws:
org.resoa.exception.ProtocolException
java.io.IOException

onInitialized

void onInitialized(Session session)
Invoked after successful session connect handshake

Parameters:
session -

onAccept

void onAccept(Session session)
Invoked after successful socket accept

Parameters:
session -

disconnect

void disconnect(Session session)
Disconnect from an address

Parameters:
session -
Throws:
org.resoa.exception.ProtocolException

disconnect

void disconnect()
Disconnect all sessions

Throws:
org.resoa.exception.ProtocolException

setConnectionAccept

void setConnectionAccept(boolean accept)
Allow or stops the connection accept.


close

void close(org.resoa.stack.config.HostStatus state,
           java.lang.String infoMsg)
Disconnect from all connections

Parameters:
state - the new state
infoMsg - a info message

init

void init(Stack stack,
          int localHostIndex)
          throws java.io.IOException
Initializes the gateway

Parameters:
stack -
localHostIndex - set to -1, if no remote connections should be accepted
Throws:
java.io.IOException

activeSessions

int activeSessions()
Returns the currently cached sessions

Returns:
the currently cached session count

pingSessions

void pingSessions()
Sends a PING ProtocolService message to all registered sessions



Copyright © 2007 www.resoa.org. All Rights Reserved.