SSF.OS.TCP.test
Class tcpClientSession

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--SSF.OS.TCP.test.tcpClientSession
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable

public class tcpClientSession
extends ProtocolSession

A simple prototype class executing one TCP client-server session; it is instantiated by SSF.OS.TCP.test.tcpClient.


Field Summary
 Continuation clientCont
          client's Continuation for this session
static int CLOSED
           
static int CLOSING
           
static int CONNECTING
           
 int fileSize
          requested file size
 int id
          client-assigned session id
 Host localHost
          Host entity where this pseudo-protocol is installed
 tcpClient owner
          client who created this session
static int READING
           
static int REQUESTING
           
 int requestSize
          size (in bytes) of request datagram sent from client to server
 socketAPI sd
          local socket used by this session
 boolean showDebug
          print out debug information
 boolean showReport
          print out summary session report
 int state
          current session state
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
tcpClientSession(tcpClient client, int sessid, tcpClient.serverData serv, int file_size)
          Constructors
 
Method Summary
 void begin(Continuation caller)
          Class Methods
 void clientDebug(int errno, java.lang.String str)
          preamble to client-side-only diagnostics
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession.
 void sessionReport(int errno, java.lang.String str)
          preamble to end2end session diagnostics
static java.lang.String stateString(int s)
           
 
Methods inherited from class SSF.OS.ProtocolSession
close, closed, config, debugIdentifier, inGraph, init, 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

CLOSED

public static final int CLOSED
See Also:
Constant Field Values

CONNECTING

public static final int CONNECTING
See Also:
Constant Field Values

REQUESTING

public static final int REQUESTING
See Also:
Constant Field Values

READING

public static final int READING
See Also:
Constant Field Values

CLOSING

public static final int CLOSING
See Also:
Constant Field Values

owner

public tcpClient owner
client who created this session


id

public int id
client-assigned session id


state

public int state
current session state


clientCont

public Continuation clientCont
client's Continuation for this session


showDebug

public boolean showDebug
print out debug information


showReport

public boolean showReport
print out summary session report


requestSize

public int requestSize
size (in bytes) of request datagram sent from client to server


fileSize

public int fileSize
requested file size


localHost

public Host localHost
Host entity where this pseudo-protocol is installed


sd

public socketAPI sd
local socket used by this session

Constructor Detail

tcpClientSession

public tcpClientSession(tcpClient client,
                        int sessid,
                        tcpClient.serverData serv,
                        int file_size)
Constructors

Method Detail

stateString

public static final java.lang.String stateString(int s)

begin

public void begin(Continuation caller)
Class Methods


clientDebug

public void clientDebug(int errno,
                        java.lang.String str)
preamble to client-side-only diagnostics


sessionReport

public void sessionReport(int errno,
                          java.lang.String str)
preamble to end2end session diagnostics


push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
             throws ProtocolException
Description copied from class: ProtocolSession
Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession. The pusher sends a reference to itself in the second argument. This push happens immediately, without any simulation time elapsing, regardless of other activities taking place in the ProtocolGraph.

If 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().

Specified by:
push in class ProtocolSession
ProtocolException