Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
utilmm::base_socket Class Reference

#include <socket.hh>

Inheritance diagram for utilmm::base_socket:
Inheritance graph

List of all members.


struct  bad_address

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)
int fd () const
void flush () const
bool try_wait (int what) const
void wait (int what) const
 ~base_socket ()

Protected Member Functions

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

Private Member Functions

int wait (int what, timeval *tv) const

Static Private Member Functions

static int to_unix (Domain d)
static int to_unix (Type t)

Private Attributes

Domain m_domain
int m_fd
Type m_type

Detailed Description

Base class for sockets

Definition at line 16 of file socket.hh.

Member Enumeration Documentation


Definition at line 19 of file socket.hh.


Definition at line 20 of file socket.hh.


Definition at line 21 of file socket.hh.

Constructor & Destructor Documentation

Definition at line 44 of file

Definition at line 46 of file

Closes the socket

Definition at line 56 of file

Member Function Documentation

int utilmm::base_socket::fd ( ) const

Get the socket file descriptor

Definition at line 124 of file

Flush all buffers related to this socket

Definition at line 160 of file

vector< uint8_t > utilmm::base_socket::to_sockaddr ( std::string const &  to) const [protected]

Definition at line 62 of file

int utilmm::base_socket::to_unix ( Domain  d) [static, private]

Definition at line 24 of file

int utilmm::base_socket::to_unix ( Type  t) [static, private]

Definition at line 34 of file

bool utilmm::base_socket::try_wait ( int  what) const

Non-blocking version of wait

whatan OR-ed field of values in the Wait enum
true if the event was present and false otherwise

Definition at line 125 of file

int utilmm::base_socket::wait ( int  what,
timeval *  tv 
) const [private]

Definition at line 131 of file

void utilmm::base_socket::wait ( int  what) const

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

whatan OR-ed field of values in the Wait enum

Definition at line 130 of file

Member Data Documentation

Definition at line 30 of file socket.hh.

Definition at line 29 of file socket.hh.

Definition at line 31 of file socket.hh.

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

Author(s): Sylvain Joyeux/
autogenerated on Thu Jan 2 2014 11:38:31