|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.inet.socket.SocketMaster
Application helper class for using InetSocket.
The master component must call processSocket(Object, Port)
in process(Object, Port)
to relay socket contract related messages for processing in this helper
class.
SocketMaster can work with both TCP_socket (for single-session
applications) and TCP_full (for multi-session applications).
By default, SocketMaster is configured to work with multiple TCP sessions
and TCP_full. To work with single-session applications (and
communicate with TCP_socket), the application should disable the
multi-session flag with setMultiSessionEnabled(boolean).
SocketContract| Constructor Summary | |
SocketMaster(Port controlPort_,
Component masterComp_)
|
|
| Method Summary | |
void |
aAccept(InetSocket serverSocket_,
NonblockingSocketHandler h_)
Accepting a new connection at the server socket. |
InetSocket |
accept(InetSocket serverSocket_)
Accepting a new connection at the server socket. |
void |
aClose(InetSocket socket_,
NonblockingSocketHandler h_)
Closes the server/client socket. |
void |
aConnect(InetSocket clientSocket_,
long remoteAddress_,
int remotePort_,
NonblockingSocketHandler h_)
Connecting to a remote node at the client socket. |
void |
bind(InetSocket socket_,
long localAddress_,
int localPort_)
Binds the server/client socket to a specific (address, port). |
void |
close(InetSocket socket_)
Closes the server/client socket. |
void |
connect(InetSocket clientSocket_,
long remoteAddress_,
int remotePort_)
Connecting to a remote node at the client socket. |
java.lang.String |
info()
|
boolean |
isMultiSessionEnabled()
|
InetSocket |
newSocket()
Creates and installs a new server/client InetSocket in this
application. |
boolean |
processSocket(java.lang.Object data_,
Port inPort_)
Processes the socket contract related messages for the master component. |
void |
reset()
|
void |
setMultiSessionEnabled(boolean enabled_)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SocketMaster(Port controlPort_,
Component masterComp_)
| Method Detail |
public void reset()
public java.lang.String info()
public InetSocket newSocket()
InetSocket in this
application.
public InetSocket accept(InetSocket serverSocket_)
throws java.io.IOException
java.io.IOException
public void aAccept(InetSocket serverSocket_,
NonblockingSocketHandler h_)
throws java.io.IOException
h_) is called back when a new connection
is established from the server socket.
java.io.IOException
public void connect(InetSocket clientSocket_,
long remoteAddress_,
int remotePort_)
throws java.io.IOException
java.io.IOException
public void aConnect(InetSocket clientSocket_,
long remoteAddress_,
int remotePort_,
NonblockingSocketHandler h_)
throws java.io.IOException
h_) is called back when the connection
is established.
java.io.IOException
public void close(InetSocket socket_)
throws java.io.IOException
java.io.IOException
public void aClose(InetSocket socket_,
NonblockingSocketHandler h_)
throws java.io.IOException
h_) is called back when the connection
is closed.
java.io.IOException
public void bind(InetSocket socket_,
long localAddress_,
int localPort_)
public boolean isMultiSessionEnabled()
public void setMultiSessionEnabled(boolean enabled_)
public boolean processSocket(java.lang.Object data_,
Port inPort_)
|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||