#include <ServerSocket.h>
Inheritance diagram for clawsoft.ServerSocket:
Definition at line 12 of file ServerSocket.h.
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 int | getSocket () |
Returns the socket's file descriptor value. | |
int | setSoTimeout (int) |
Defines the timeout before closing connection to the other end of communication. | |
char * | getClassName () |
Returns the name of the current class. | |
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. | |
int | setTCPOption (int opname, void *optval, unsigned int siz) |
void | setClassName (char *n) |
Call this method when you need to set the name of the class you're creating, typically int it's constructor, remeber that you must set the classname for every clas you create, that way you can have more information while being in a debuging process. | |
Protected Attributes | |
int | maxConn |
Stores the value of the backlog parameter for the listen(2) system call. | |
int | sock |
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.
Definition at line 22 of file ServerSocket.cpp. References clawsoft.ServerSocket.CreateSocket(), and clawsoft.Object.setClassName(). |
|
Destroys the server socket closing connection to every client connected.
Definition at line 27 of file ServerSocket.h. References clawsoft.ServerSocket.close(). |
|
Waits for a client to connect from a remote host returning it's client socket.
Definition at line 79 of file ServerSocket.cpp. References clawsoft.ServerSocket.maxConn, clawsoft.SocketBase.port, and clawsoft.SocketBase.sock. Referenced by Server.start(). |
|
Closes communication to all clients and shuts down the socket.
Definition at line 103 of file ServerSocket.cpp. References clawsoft.SocketBase.sock. Referenced by clawsoft.ServerSocket.~ServerSocket(). |
|
This method binds a server socket to the port specified by theport.
Definition at line 27 of file ServerSocket.cpp. References clawsoft.addSigpipeHandler(), clawsoft.ServerSocket.maxConn, clawsoft.SocketBase.port, and clawsoft.SocketBase.sock. Referenced by clawsoft.ServerSocket.ServerSocket(). |
|
Returns the name of the current class.
Definition at line 18 of file Object.cpp. References clawsoft.Object.__cls_name. |
|
Returns the port number where the server socket was bounded.
Definition at line 36 of file ServerSocket.h. References clawsoft.SocketBase.port. |
|
Returns the socket's file descriptor value.
Definition at line 38 of file SocketBase.h. References clawsoft.SocketBase.sock. |
|
|
Is an interface to setsockopt.
Definition at line 13 of file SocketBase.cpp. References clawsoft.SocketBase.sock. Referenced by clawsoft.SocketBase.setSoTimeout(). |
|
Defines the timeout before closing connection to the other end of communication.
Definition at line 28 of file SocketBase.cpp. References clawsoft.SocketBase.setSockOption(). |
|
Definition at line 23 of file SocketBase.cpp. |
|
Stores the value of the backlog parameter for the listen(2) system call.
Definition at line 20 of file ServerSocket.h. Referenced by clawsoft.ServerSocket.accept(), and clawsoft.ServerSocket.CreateSocket(). |
|
Defines the communications port used by the socket or the port which the socket server uses to listen requests.
Definition at line 27 of file SocketBase.h. Referenced by clawsoft.ServerSocket.accept(), clawsoft.Socket.CreateSocket(), clawsoft.ServerSocket.CreateSocket(), clawsoft.Socket.getPort(), clawsoft.ServerSocket.getPort(), clawsoft.Socket.operator=(), and clawsoft.Socket.Socket(). |
|
This file descriptor represents the socket itself as returned by socket(2) and accept(2).
Definition at line 22 of file SocketBase.h. Referenced by clawsoft.ServerSocket.accept(), clawsoft.Socket.close(), clawsoft.ServerSocket.close(), clawsoft.Socket.CreateSocket(), clawsoft.ServerSocket.CreateSocket(), clawsoft.SocketBase.getSocket(), clawsoft.Socket.operator=(), clawsoft.Socket.operator>>(), clawsoft.Socket.read(), clawsoft.SocketBase.setSockOption(), clawsoft.Socket.Socket(), and clawsoft.Socket.write(). |
Powered by: