MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SocketServer Class Reference

#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 NdbThreadstartServer ()
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 *)

Detailed Description

Socket Server

Definition at line 32 of file SocketServer.hpp.

Constructor & Destructor Documentation

SocketServer::SocketServer ( unsigned  maxSessions = ~(unsigned)0)

Constructor / Destructor

Definition at line 29 of file SocketServer.cpp.

Member Function Documentation

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.

struct NdbThread * SocketServer::startServer ( )
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.

bool SocketServer::tryBind ( unsigned short  port,
const char *  intface = 0 
)
static

Setup socket and bind it then close the socket Returns true if succeding in binding

Definition at line 53 of file SocketServer.cpp.

Here is the caller graph for this function:


The documentation for this class was generated from the following files: