Kyoto Tycoon
|
Network server abstraction based on TCP/IP. More...
#include <ktsocket.h>
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. |
Network server abstraction based on TCP/IP.
kyototycoon::ServerSocket::ServerSocket | ( | ) | [explicit] |
Default constructor.
Destructor.
const char* kyototycoon::ServerSocket::error | ( | ) |
Get the last happened error information.
bool kyototycoon::ServerSocket::open | ( | const std::string & | expr | ) |
Open a server socket.
expr | an expression of the address and the port of the server. |
bool kyototycoon::ServerSocket::close | ( | ) |
Close the socket.
bool kyototycoon::ServerSocket::accept | ( | Socket * | sock | ) |
Accept a connection from a client.
sock | the socket object to manage the connection. |
bool kyototycoon::ServerSocket::abort | ( | ) |
Abort the current operation.
bool kyototycoon::ServerSocket::set_timeout | ( | double | timeout | ) |
Set the timeout of each operation.
timeout | the timeout of each operation in seconds. |
const std::string kyototycoon::ServerSocket::expression | ( | ) |
Get the expression of the socket.
int32_t kyototycoon::ServerSocket::descriptor | ( | ) | [virtual] |
Get the descriptor integer.
Implements kyototycoon::Pollable.
void kyototycoon::ServerSocket::set_event_flags | ( | uint32_t | flags | ) | [virtual] |
Set event flags.
flags | specifies 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.
uint32_t kyototycoon::ServerSocket::event_flags | ( | ) | [virtual] |