MySQL 5.6.14 Source Code Document
|
#include <SocketServer.hpp>
Classes | |
class | Service |
struct | ServiceInstance |
class | Session |
struct | SessionInstance |
Public Member Functions | |
SocketServer (unsigned maxSessions=~(unsigned) 0) | |
bool | setup (Service *, unsigned short *port, const char *pinterface=0) |
struct NdbThread * | startServer () |
void | stopServer () |
bool | stopSessions (bool wait=false, unsigned wait_timeout=0) |
void | foreachSession (void(*f)(Session *, void *), void *data) |
void | checkSessions () |
Static Public Member Functions | |
static bool | tryBind (unsigned short port, const char *intface=0) |
Friends | |
void * | socketServerThread_C (void *) |
void * | sessionThread_C (void *) |
Socket Server
Definition at line 32 of file SocketServer.hpp.
SocketServer::SocketServer | ( | unsigned | maxSessions = ~(unsigned)0 | ) |
Constructor / Destructor
Definition at line 29 of file SocketServer.cpp.
bool SocketServer::setup | ( | SocketServer::Service * | service, |
unsigned short * | port, | ||
const char * | pinterface = 0 |
||
) |
Setup socket bind & listen Returns false if no success
Definition at line 88 of file SocketServer.cpp.
|
read |
start/stop the server
Definition at line 235 of file SocketServer.cpp.
bool SocketServer::stopSessions | ( | bool | wait = false , |
unsigned | wait_timeout = 0 |
||
) |
stop sessions
Note: Implies previous stopServer
wait, wait until all sessions has stopped if true wait_timeout - wait, but abort wait after this time(in milliseconds) 0 = infinite
returns false if wait was abandoned
Definition at line 355 of file SocketServer.cpp.
|
static |
Setup socket and bind it then close the socket Returns true if succeding in binding
Definition at line 53 of file SocketServer.cpp.