Kyoto Tycoon
Public Member Functions
kyototycoon::ServerSocket Class Reference

Network server abstraction based on TCP/IP. More...

#include <ktsocket.h>

List of all members.

Public Member Functions

 ServerSocket ()
 Default constructor.
 ~ServerSocket ()
 Destructor.
const char * error ()
 Get the last happened error information.
bool open (const std::string &expr)
 Open a server socket.
bool close ()
 Close the socket.
bool accept (Socket *sock)
 Accept a connection from a client.
bool abort ()
 Abort the current operation.
bool set_timeout (double timeout)
 Set the timeout of each operation.
const std::string expression ()
 Get the expression of the socket.
int32_t descriptor ()
 Get the descriptor integer.
void set_event_flags (uint32_t flags)
 Set event flags.
uint32_t event_flags ()
 Get the current event flags.

Detailed Description

Network server abstraction based on TCP/IP.


Constructor & Destructor Documentation

Default constructor.

Destructor.


Member Function Documentation

Get the last happened error information.

Returns:
the last happened error information.
bool kyototycoon::ServerSocket::open ( const std::string &  expr)

Open a server socket.

Parameters:
expran expression of the address and the port of the server.
Returns:
true on success, or false on failure.

Close the socket.

Returns:
true on success, or false on failure.

Accept a connection from a client.

Parameters:
sockthe socket object to manage the connection.
Returns:
true on success, or false on failure.

Abort the current operation.

Returns:
true on success, or false on failure.
bool kyototycoon::ServerSocket::set_timeout ( double  timeout)

Set the timeout of each operation.

Parameters:
timeoutthe timeout of each operation in seconds.
Returns:
true on success, or false on failure.

Get the expression of the socket.

Returns:
the expression of the socket or an empty string on failure.

Get the descriptor integer.

Returns:
the descriptor integer, or -1 on failure.

Implements kyototycoon::Pollable.

void kyototycoon::ServerSocket::set_event_flags ( uint32_t  flags) [virtual]

Set event flags.

Parameters:
flagsspecifies the event mode. The following may be added by bitwise-or: ServerSocket::EVINPUT for input events, ServerSocket::EVOUTPUT for output events, ServerSocket::EVERROR for error events.

Implements kyototycoon::Pollable.

Get the current event flags.

Returns:
the current event flags.

Implements kyototycoon::Pollable.