The original object used to manage data flow into and out of the server program.
Public Fields
-
int socketHandle
- File descriptor returned by socket system call
-
int port
- Port on host that clients will connect to
-
char dataFormat
- When data is exchanged, will it be in ascii/binary format?
-
queue<char*> dataQueue
- data waiting to go out - only used by writers
-
queue<int> dataSize
- nuber of bytes in data
-
list<int> clients
- socket descriptor for clients connected
-
char* remainingData
- holder for leftover data
-
int remainingLength
- length of remaining data
-
bool verbose
- If this is true, them the server should output activity to stdout
-
char* name
- For automatic port assignments, use a name to reference the server
Public Methods
-
void append( int &length, char* &buffer )
- add some amount of data read off a socket onto the remainingData
-
int parse()
- do as best as you can to parse data from remaining data
-
void setVerbose( int mode )
- set whether the server should be verbose or not
-
void reset()
- clear queues, pending data, clients
-
void setName( char* newName )
- Sets the name of this server to a newName.
-
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.
- int socketHandle
- File descriptor returned by socket system call
- int port
- Port on host that clients will connect to
- char dataFormat
- When data is exchanged, will it be in ascii/binary format?
- queue<char*> dataQueue
- data waiting to go out - only used by writers
- queue<int> dataSize
- nuber of bytes in data
- list<int> clients
- socket descriptor for clients connected
- char* remainingData
- holder for leftover data
- int remainingLength
- length of remaining data
- bool verbose
- If this is true, them the server should output activity to stdout
- char* name
- For automatic port assignments, use a name to reference the server
- void append( int &length, char* &buffer )
- add some amount of data read off a socket onto the remainingData
- int parse()
- do as best as you can to parse data from remaining data
- void setVerbose( int mode )
- set whether the server should be verbose or not
- void reset()
- clear queues, pending data, clients
- void 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.
- 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.
- 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++.