Util--  1.1
Public Member Functions | List of all members
utilmm::server_socket Class Reference

#include <utilmm/system/socket.hh>

Inheritance diagram for utilmm::server_socket:
Inheritance graph
[legend]
Collaboration diagram for utilmm::server_socket:
Collaboration graph
[legend]

Public Member Functions

 server_socket (Domain domain, Type type, std::string const &bind_to, int backlog=256)
 
void bind (std::string const &to)
 
socketaccept () const
 
bool try_wait () const
 
void wait () const
 
- Public Member Functions inherited from utilmm::base_socket
 base_socket (int fd)
 
 base_socket (Domain domain, Type type)
 
 ~base_socket ()
 
int fd () const
 
bool try_wait (int what) const
 
void wait (int what) const
 
void flush () const
 

Additional Inherited Members

- Public Types inherited from utilmm::base_socket
enum  Domain { Unix, Inet }
 
enum  Type { Stream, Datagram }
 
enum  Wait { WaitRead = 1, WaitWrite = 2, WaitException = 4 }
 
- Protected Member Functions inherited from utilmm::base_socket
std::vector< uint8_t > to_sockaddr (std::string const &to) const
 

Detailed Description

A socket class holding servers (i.e. listening sockets)

Constructor & Destructor Documentation

◆ server_socket()

utilmm::server_socket::server_socket ( Domain  domain,
Type  type,
std::string const &  bind_to,
int  backlog = 256 
)

Member Function Documentation

◆ accept()

socket* utilmm::server_socket::accept ( ) const

Waits for an incoming connection If block is true, wait for a connection. If it is false, do not block and return NULL if there is no connection available

◆ bind()

void utilmm::server_socket::bind ( std::string const &  to)

◆ try_wait()

bool utilmm::server_socket::try_wait ( ) const

Checks if there is an incoming connection in the connection queue.

Returns
true if it is the case (i.e. accept() will return a socket) and false otherwise

◆ wait()

void utilmm::server_socket::wait ( ) const

Waits for an incoming connection


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

Generated on Wed Oct 17 2018 09:34:19 for Util-- by doxygen 1.8.13
SourceForge.net Project Page