1 #ifndef _FIBERIO_SERVER_SOCKET_H_ 2 #define _FIBERIO_SERVER_SOCKET_H_ 11 class server_socket_impl;
33 void bind(
const std::string& host, uint16_t port);
62 std::unique_ptr<server_socket_impl> impl_;
uint16_t get_port()
Return the port that the server_socket is bound to.
server_socket()
Creates an unbound listening socket.
void close()
Close the listening socket and stop listening for connections.
Server socket for listening for incoming connections.
socket accept()
Accept an incoming connection and get a socket representing it.
void bind(const std::string &host, uint16_t port)
Binds the server_socket to an address and port.
std::string get_host()
Return the host that the server_socket is bound to.
Client socket for communicating over a network and opening connections.
~server_socket()
Destructor. Closes the server_socket if it's open.
void listen(int backlog)
Start listening for connections with a certain backlog size.