class DDserver

The DDserver is the server on the same host as the DD pool, which talks to a remote DD client.

Public Methods

[more]static void startup( int socket_fd )
Global startup procedure called by the DDdemon.
[more]inline int getConnectionStatus() const
Returns the status word of the last connection operations
[more]static BOOL determineEndianess()
Returns true if we have the network endianess.
[more]void handleRequests()
Reads a request from the socket to the remote client and executes it


Documentation

The DDserver is the server on the same host as the DD pool, which talks to a remote DD client. There is one DDserver per client.
The server is forked off by the DDdemon upon request of a remote client and connects itself through a socket the client. It receives the commands from the socket, interprets and executes them and returns the result to the client.
Commands in form of the class ddnCmd are exchanged between server and client. The typical mode of operation is that the server waits on the socket to received an instance of the class ddnCmd and reads its command code. Then depending on the command code it reads additional parameter from the socket, before calling the corresponding DD routines. Note that this might also take some time, especially when the server wants to retrieve a rare event from the pool which may involving sleeping on a semaphore. Finally the server returns all parameters back to the client.

We follow the philosophy of the network utilities of the package OTOOLS.

The server is invokes after fork by the DD demon by calling the static member function startup, which in turn creates the DDserver object.

ostatic void startup( int socket_fd )
Global startup procedure called by the DDdemon. It instantiates one DDserver object, checks the connection status and then goes into an infinite loop handleRequests from which it exits if there is an exit command or an error.

oinline int getConnectionStatus() const
Returns the status word of the last connection operations

ostatic BOOL determineEndianess()
Returns true if we have the network endianess. Uses htonl.

ovoid handleRequests()
Reads a request from the socket to the remote client and executes it

oint createDD()
Read the DD pool parameters from the socket and create the pool

oint deleteDD()
Delete the pool

oint createFifo()
Read the fifo parameters from the socket and create the fifo

oint deleteFifo()
Delete the fifo

oint enableEvents( int iFifoNameLen = 0 )
Reads the name of the fifo from the socket and enables it

oint disableEvents( int iFifoNameLen = 0 )
Reads the name of the fifo from the socket and disables it

oint reqFev( int iSize )
Requests a Fev from the DD pool and writes it into the socket for the client to read.

oint putFev( int iOptFifoNameLen = 0 )
Puts an event into the DD pool

oint getFev( int iOptFifoNameLen = 0 )
Gets an event from the DD pool and writes it into the socket

oint reqNFev( int iSize )
Requests a Fev from the DD pool and writes it into the socket for the client to read.

oint putNFev( int iOptFifoNameLen = 0 )
Puts an event into the DD pool

oint getNFev( int iOptFifoNameLen = 0 )
Gets an event from the DD pool and writes it into the socket

oint testTrf( int nTimes )
testTrf command. Simply read a test block from the socket. Used to measure connection and speed

o to remember fev's that have been retrieved out of the DD system
to remember fev's that have been retrieved out of the DD system


This class has no child classes.
Author:
C.Witzig
Date: May 23, 99
Version:
Last update August 18, 99

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.