|
bitz-server
0.1.6
|
#include <socket.h>
Public Member Functions | |
| TCPServerSocketM (unsigned short localPort, int queueLen=5) throw (SocketException) | |
| TCPSocket * | accept () throw (SocketException) |
| bool | pendingConnections () throw (SocketException) |
| int | getWaitingClients (vector< TCPSocket * > &clients) throw (SocketException) |
| void | closeClientConnection (TCPSocket *client) |
Public Member Functions inherited from socketlibrary::TCPServerSocket | |
| TCPServerSocket (unsigned short localPort, int queueLen=5) throw (SocketException) | |
| TCPServerSocket (const string &localAddress, unsigned short localPort, int queueLen=5) throw (SocketException) | |
| TCPSocket * | accept () throw (SocketException) |
Public Member Functions inherited from socketlibrary::Socket | |
| ~Socket () | |
| string | getLocalAddress () throw (SocketException) |
| unsigned short | getLocalPort () throw (SocketException) |
| void | setLocalPort (unsigned short localPort) throw (SocketException) |
| void | setLocalAddressAndPort (const string &localAddress, unsigned short localPort=0) throw (SocketException) |
Additional Inherited Members | |
Static Public Member Functions inherited from socketlibrary::Socket | |
| static void | cleanUp () throw (SocketException) |
| static unsigned short | resolveService (const string &service, const string &protocol="tcp") |
Protected Member Functions inherited from socketlibrary::Socket | |
| Socket (int type, int protocol) throw (SocketException) | |
| Socket (int sock) | |
Protected Attributes inherited from socketlibrary::Socket | |
| int | sock |
TCP socket class for multi-client servers
| socketlibrary::TCPServerSocketM::TCPServerSocketM | ( | unsigned short | localPort, |
| int | queueLen = 5 |
||
| ) | |||
| throw | ( | SocketException | |
| ) | |||
Construct a TCP socket for use with a server, accepting connections on the specified port on any interface
| localPort | local port of server socket, a value of zero will give a system-assigned unused port |
| queueLen | maximum queue length for outstanding connection requests (default 5) |
| SocketException | thrown if unable to create TCP server socket |
| TCPSocket * socketlibrary::TCPServerSocketM::accept | ( | ) | ||
| throw | ( | SocketException | ||
| ) | ||||
Blocks until a new connection is established on this socket or error
| SocketException | thrown if attempt to accept a new connection fails |
| void socketlibrary::TCPServerSocketM::closeClientConnection | ( | TCPSocket * | client | ) |
Closes the connection to a client
| client | the client TCPSocket to close |
| int socketlibrary::TCPServerSocketM::getWaitingClients | ( | vector< TCPSocket * > & | clients | ) | |
| throw | ( | SocketException | |||
| ) | |||||
Checks for read waiting clients
| clients | a vector of TCPSocket pointers to get the waiting clients |
| SocketException | thrown if attempt to check for waiting clients fail |
| bool socketlibrary::TCPServerSocketM::pendingConnections | ( | ) | ||
| throw | ( | SocketException | ||
| ) | ||||
Checks for incoming connections or error
| SocketException | thrown if attempt to check for new connections fail |
1.8.9.1