SSF.OS.WWW
Class httpServer

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--SSF.OS.WWW.httpServer
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable

public class httpServer
extends ProtocolSession

A simple HTTP server traffic generator. The server configures itself from the DML file. After receiving an httpRequest, the server spawns a slave server that first sends an httpResponse, and then sends the virtual data to the client until the request is fulfilled, and possibly closes the TCP connection if the httpRequest contained the CLOSE directive.

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 httpServer has a distinct wellKnownPort number.


Field Summary
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
httpServer()
          Constructors
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          httpServer configuration.
 void init()
          Start the server
 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
 

Constructor Detail

httpServer

public httpServer()
Constructors

Method Detail

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
httpServer configuration. Example of supported DML attributes:
   ProtocolSession [ name server use SSF.OS.WWW.httpServer
     port 80            # server's HTTP port

     client_limit  10     # 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   5      # 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.

     # distribution of the number of objects in a page request:
     # if random variable = 0, round up to 1
     # NOTE: the response to page request contains the 1st object

     objects_in_page [
       distribution [
         name "Pareto"              # distribution class name
         k 0.6667                   # scale (cutoff) parameter
         alpha 1.2                  # shape (exponent) parameter
       ]
     ]

     # distribution of sizes of objects (in bytes)
     # if random variable = 0, round up to 1

     object_size [
       distribution [
         name "Pareto"              # distribution class name
         k 2000.0                   # scale (cutoff) parameter
         alpha 1.2                  # shape (exponent) parameter
       ]
     ]

     # distribution of server delays between request and response (in seconds)
     # NOT IMPLEMENTED

     response_delay [
       distribution [
         name "Exponential"           # distribution class name
         lambda 10.0                  # mean = 1/lambda
       ]
     ]

     http_hdr_size 1000  # nominal HTTP header size (virtual bytes) read from a socket
                         # before reading data (if indicated by http header)

     show_report true    # print client-server session summary report
     debug false         # print verbose client/server diagnostics

   ]
 

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class ProtocolSession
com.renesys.raceway.DML.configException

init

public void init()
Start the server

Overrides:
init in class ProtocolSession

serv

public void serv()

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