|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--SSF.OS.ProtocolSession
|
+--SSF.OS.TCP.test.tcpServer
A simple TCP server application provided as an example. The server configures itself from the DML file. The client-server protocol is absolutely minimal: the client sends to server's well known address just one integer that specifies the total amount of virtual data it requests. After receiving a client's request, the server spawns a slave server that sends the virtual data to the client until the request is fulfilled. The default is no limit on the number of clients, unless the attribute client_limit is set. There is no limit on the number of servers that can coexist in a single Host as long as each tcpServer has a distinct wellKnownPort number.
| Field Summary | |
int |
client_limit
max number of simultaneous client connections serviced byf this server - default is unlimited (Integer.MAX_VALUE). |
int |
clientNumber
ID of the latest client connection serviced by this server |
boolean |
debug
default is don't print verbose debugging information |
Host |
localHost
Host entity where this pseudo-protocol is installed |
int |
localIP
Host's IP address |
java.lang.String |
localNHI
Host's NHI address |
tcpSocket |
lsd
"listening" socket of this server |
int |
qlimit
The maximum size of pending connection request queue, Qlimit, that determines when the server socket rejects connection requests. |
int |
request_size
size of data request object from matching client |
boolean |
show_report
default is show summary session information |
socketMaster |
socketms
Host's Socket ProtocolSession |
| Fields inherited from class SSF.OS.ProtocolSession |
name, use |
| Constructor Summary | |
tcpServer()
Constructors |
|
| Method Summary | |
void |
config(com.renesys.raceway.DML.Configuration cfg)
Server configuration. |
void |
init()
Initialization routine, called by the ProtocolGraph after instantiation. |
boolean |
push(ProtocolMessage message,
ProtocolSession fromSession)
Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession. |
void |
serv()
|
| Methods inherited from class SSF.OS.ProtocolSession |
close, closed, debugIdentifier, inGraph, open, opened, pushAfterDelay, pushAfterDelayFailed, setGraph, version |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public int request_size
public tcpSocket lsd
public int client_limit
public int clientNumber
public int qlimit
tcpSocketpublic Host localHost
public int localIP
public java.lang.String localNHI
public socketMaster socketms
public boolean debug
public boolean show_report
| Constructor Detail |
public tcpServer()
| Method Detail |
public void config(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
ProtocolSession [ name server use SSF.OS.TCP.test.tcpServer
port %I # server's well known port (int)
client_limit %I # max number of simultaneous established client
# connections, if omitted, default is unlimited.
# If exceeded, connection request is ignored
# and left to time out.
queue_limit %I # maximum size of pending connection request
# queue, Qlimit, if omitted default is 5.
# Determines the total number of pending
# connection requests (see SSF.OS.TCP.tcpSocket).
# If exceeded, the listening socket sends RESET
# to client and drops the request.
request_size %I # nominal size of client request datagram (bytes, int)
# (must be the same for the client)
show_report %S # print client-server session summary report, true/false
debug %S # print verbose server diagnostics, true/false
]
config in interface com.renesys.raceway.DML.Configurableconfig in class ProtocolSessioncom.renesys.raceway.DML.configExceptionpublic void init()
ProtocolSession
init in class ProtocolSessionpublic void serv()
public boolean push(ProtocolMessage message,
ProtocolSession fromSession)
throws ProtocolException
ProtocolSessionIf you desire "safe" interaction with other CPU activities, even though your push() consumes no measurable/modelable CPU cycles, define the "cpudelay true" attribute for the ProtocolGraph and use pushAfterDelay(message,fromSession,0.0). This will guarantee proper ordering; that is, the framework will wait until the CPU is free before proceeding with the requested push().
push in class ProtocolSessionProtocolException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||