Util--  1.1
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
utilmm::base_socket Class Reference

#include <utilmm/system/socket.hh>

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

Public Types

enum  Domain { Unix, Inet }
 
enum  Type { Stream, Datagram }
 
enum  Wait { WaitRead = 1, WaitWrite = 2, WaitException = 4 }
 

Public Member Functions

 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
 

Protected Member Functions

std::vector< uint8_t > to_sockaddr (std::string const &to) const
 

Detailed Description

Base class for sockets

Member Enumeration Documentation

Enumerator
Unix 
Inet 
Enumerator
Stream 
Datagram 
Enumerator
WaitRead 
WaitWrite 
WaitException 

Constructor & Destructor Documentation

utilmm::base_socket::base_socket ( int  fd)
utilmm::base_socket::base_socket ( Domain  domain,
Type  type 
)
utilmm::base_socket::~base_socket ( )

Closes the socket

Member Function Documentation

int utilmm::base_socket::fd ( ) const

Get the socket file descriptor

void utilmm::base_socket::flush ( ) const

Flush all buffers related to this socket

std::vector<uint8_t> utilmm::base_socket::to_sockaddr ( std::string const &  to) const
protected
bool utilmm::base_socket::try_wait ( int  what) const

Non-blocking version of wait

Parameters
whatan OR-ed field of values in the Wait enum
Returns
true if the event was present and false otherwise
void utilmm::base_socket::wait ( int  what) const

Blocks until one of the specified events is detected on this socket

Parameters
whatan OR-ed field of values in the Wait enum

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

Generated on Tue Oct 9 2018 10:12:45 for Util-- by doxygen 1.8.6
SourceForge.net Project Page