◆ Server() [1/2]
Server::Server |
( |
unsigned short |
port = 0 , |
|
|
const std::string & |
iface = "0.0.0.0" |
|
) |
| |
Create a TCP server socket.
- Parameters
-
port | The TCP port to listen to. |
iface | The network interface to bind to. |
◆ Server() [2/2]
Server::Server |
( |
const std::string & |
iface, |
|
|
unsigned short |
port = 0 |
|
) |
| |
Create a TCP server socket.
- Parameters
-
port | The TCP port to listen to. |
iface | The network interface to bind to. |
◆ ~Server()
Close the TCP server socket.
◆ initialize()
void Server::initialize |
( |
const std::string & |
iface, |
|
|
unsigned short |
port |
|
) |
| |
|
private |
◆ get_interface()
std::string Server::get_interface |
( |
| ) |
const |
Get the name given in the constructor for the network interface.
◆ get_port()
unsigned short Server::get_port |
( |
| ) |
const |
Get the port that the TCP server socket currently listens to.
◆ get_accept_event()
Produces an event that can be observed by an Event_Watcher.
This event signals incoming connections that can be accepted.
◆ accept()
Accept an incoming connection.
blocks if necessary.
- Returns
- The new TCP connection. The connection has to be deleted by the caller.
◆ try_accept()
Accept an incoming connection if it can be done without blocking.
- Returns
- The new TCP connection or 0 if there is no immediate connection. The connection has to be deleted by the caller.
◆ sock_addr
sockaddr_in MHA_TCP::Server::sock_addr |
|
private |
◆ serversocket
SOCKET MHA_TCP::Server::serversocket |
|
private |
◆ iface
std::string MHA_TCP::Server::iface |
|
private |
◆ port
unsigned short MHA_TCP::Server::port |
|
private |
◆ accept_event
The documentation for this class was generated from the following files: