#include <ServerSocket.h>
Inheritance diagram for clawsoft::ServerSocket:
Public Methods | |
ServerSocket (const int pport, const int m=256) | |
This constructor takes as an argument the port where to listen requests and the size of the backlog. | |
virtual | ~ServerSocket () |
Destroys the server socket closing connection to every client connected. | |
virtual Socket * | accept () |
Waits for a client to connect from a remote host returning it's client socket. | |
virtual void | close () |
Closes communication to all clients and shuts down the socket. | |
const int | getPort () |
Returns the port number where the server socket was bounded. | |
const TCPsocket | getSocket () |
Returns the socket's file descriptor value. | |
int | setSoTimeout (int) |
Defines the timeout before closing connection to the other end of communication. | |
const char * | getClassName () |
Returns the name of the current class. | |
Static Public Methods | |
int | installedCPUs () |
This will return how many CPUs are installed in the system. | |
double | cpuSpeed () |
This will return the CPU speed in megahertz. | |
int | totalMemory () |
Will return the total amount of system memory. | |
int | freeMemory () |
Will return the total amount of free system memory. | |
void | usleep (Uint32 usec) |
Will freeze the software for usec microseconds. | |
Protected Methods | |
int | CreateSocket (const int theport, const int m=256) |
This method binds a server socket to the port specified by theport. | |
int | setSockOption (int opname, void *optval, unsigned int siz) |
Is an interface to setsockopt. | |
void | setClassName (const char *n) |
Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging. | |
Protected Attributes | |
int | maxConn |
Stores the value of the backlog parameter for the listen(2) system call. | |
TCPsocket | tcpsock |
This file descriptor represents the socket itself as returned by socket(2) and accept(2). | |
int | port |
Defines the communications port used by the socket or the port which the socket server uses to listen requests. |
|
This constructor takes as an argument the port where to listen requests and the size of the backlog.
|
|
Destroys the server socket closing connection to every client connected.
|
|
Waits for a client to connect from a remote host returning it's client socket.
|
|
Closes communication to all clients and shuts down the socket.
|
|
This will return the CPU speed in megahertz.
|
|
This method binds a server socket to the port specified by theport.
|
|
Will return the total amount of free system memory.
|
|
Returns the name of the current class.
|
|
Returns the port number where the server socket was bounded.
|
|
Returns the socket's file descriptor value.
|
|
This will return how many CPUs are installed in the system.
|
|
Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.
|
|
Is an interface to setsockopt.
|
|
Defines the timeout before closing connection to the other end of communication.
|
|
Will return the total amount of system memory.
|
|
Will freeze the software for usec microseconds.
|
|
Stores the value of the backlog parameter for the listen(2) system call.
|
|
Defines the communications port used by the socket or the port which the socket server uses to listen requests.
|
|
This file descriptor represents the socket itself as returned by socket(2) and accept(2).
|
Authors:
Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara
Powered by: