#include <SocketServer.hpp>
Public Member Functions | |
void | acceptConnections (int ListenPort, SocketDomain Domain=SOCKET_INTERNET, SocketType Type=SOCKET_STREAM) |
Start accepting incoming connections. | |
virtual void | onSocketServerConnect (boost::shared_ptr< Socket > pSocket) |
Event triggered when a new connection is detected. | |
virtual void | onSocketServerDisconnect (Socket const &socket) |
Event triggered on a socket disconnect. | |
virtual void | onSocketServerMessage (Socket const &socket, std::string const &Message) |
Event triggered on a socket message. | |
virtual void | onSocketServerRead (Socket const &socket, DynamicBuffer< char > &ReadBuffer) |
Event triggered on a socket read. | |
void | shutdown () |
Shutdown socket processing. | |
void | threadProc () |
The thread procedure loop. | |
SocketServer () | |
Default Constructor. | |
virtual | ~SocketServer () |
Destructor. | |
Classes | |
struct | SocketServerThreadProc |
This creates generic a threaded network server
Definition at line 61 of file SocketServer.hpp.
void SocketServer::acceptConnections | ( | int | ListenPort, | |
SocketDomain | Domain = SOCKET_INTERNET , |
|||
SocketType | Type = SOCKET_STREAM | |||
) |
Start accepting incoming connections.
Definition at line 72 of file SocketServer.cpp.
References H::Socket::bind(), H::Socket::createSocket(), H::Socket::listen(), H::Socket::mPort, H::Socket::mSocket, and SOCKET_ERROR.
void SocketServer::onSocketServerConnect | ( | boost::shared_ptr< Socket > | pSocket | ) | [virtual] |
Event triggered when a new connection is detected.
pSocket | The new socket |
Definition at line 141 of file SocketServer.cpp.
References cdbg.
Referenced by threadProc().
void SocketServer::onSocketServerDisconnect | ( | Socket const & | socket | ) | [virtual] |
Event triggered on a socket disconnect.
socket | The socket |
Definition at line 150 of file SocketServer.cpp.
References cdbg.
void SocketServer::onSocketServerMessage | ( | Socket const & | socket, | |
std::string const & | Message | |||
) | [virtual] |
Event triggered on a socket message.
Event triggered on a socket server message.
socket | The Socket that triggered the event | |
Message | The message |
Definition at line 160 of file SocketServer.cpp.
References cdbg.
void SocketServer::onSocketServerRead | ( | Socket const & | socket, | |
DynamicBuffer< char > & | ReadBuffer | |||
) | [virtual] |
Event triggered on a socket read.
socket | The socket | |
ReadBuffer | The data |
Definition at line 170 of file SocketServer.cpp.
References cdbg, and H::DynamicBuffer< DataType >::length().
void SocketServer::shutdown | ( | ) |
Shutdown socket processing.
Shutdown all socket processing.
Reimplemented from H::Socket.
Definition at line 178 of file SocketServer.cpp.
References cdbg5, H::Socket::mProcessing, and H::UtilTime::sleep().
Referenced by ~SocketServer().