class Server

The original object used to manage data flow into and out of the server program.

Public Fields

[more]int socketHandle
File descriptor returned by socket system call
[more]int port
Port on host that clients will connect to
[more]char dataFormat
When data is exchanged, will it be in ascii/binary format?
[more]queue<char*> dataQueue
data waiting to go out - only used by writers
[more]queue<int> dataSize
nuber of bytes in data
[more]list<int> clients
socket descriptor for clients connected
[more]char* remainingData
holder for leftover data
[more]int remainingLength
length of remaining data
[more]bool verbose
If this is true, them the server should output activity to stdout
[more]char* name
For automatic port assignments, use a name to reference the server

Public Methods

[more]void append( int &length, char* &buffer )
add some amount of data read off a socket onto the remainingData
[more]int parse()
do as best as you can to parse data from remaining data
[more]void setVerbose( int mode )
set whether the server should be verbose or not
[more]void reset()
clear queues, pending data, clients
[more]void setName( char* newName )
Sets the name of this server to a newName.
[more]int getPort( char* targetName )
Check whether a string is the same as this server's name, and return this server's port value if it is; otherwise, return -1.


Documentation

The original object used to manage data flow into and out of the server program. This Server object handled one port and clients could connect to it. Is mostly deprecated with creation of the Connection object.
oint socketHandle
File descriptor returned by socket system call

oint port
Port on host that clients will connect to

ochar dataFormat
When data is exchanged, will it be in ascii/binary format?

oqueue<char*> dataQueue
data waiting to go out - only used by writers

oqueue<int> dataSize
nuber of bytes in data

olist<int> clients
socket descriptor for clients connected

ochar* remainingData
holder for leftover data

oint remainingLength
length of remaining data

obool verbose
If this is true, them the server should output activity to stdout

ochar* name
For automatic port assignments, use a name to reference the server

ovoid append( int &length, char* &buffer )
add some amount of data read off a socket onto the remainingData

oint parse()
do as best as you can to parse data from remaining data

ovoid setVerbose( int mode )
set whether the server should be verbose or not

ovoid reset()
clear queues, pending data, clients

ovoid setName( char* newName )
Sets the name of this server to a newName. If this server already had a name, it deallocates that original name, and reallocates memory for the new name.
Parameters:
newName - String to set this server's name to.

oint getPort( char* targetName )
Check whether a string is the same as this server's name, and return this server's port value if it is; otherwise, return -1.
Parameters:
targetName - String to compare this server's name with
Returns:
-1 if not a match, this server's port value if the names match


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



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