utilmm::base_socket Class Reference
[OS-related tools]

#include <socket.hh>

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

List of all members.

Classes

struct  bad_address

Public Types

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

Public Member Functions

 base_socket (Domain domain, Type type)
 base_socket (int fd)
 base_socket (Domain domain, Type type)
 base_socket (int fd)
int fd () const
int fd () const
void flush () const
void flush () const
bool try_wait (int what) const
bool try_wait (int what) const
void wait (int what) const
void wait (int what) const
 ~base_socket ()
 ~base_socket ()

Protected Member Functions

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

Private Member Functions

int wait (int what, timeval *tv) const
int wait (int what, timeval *tv) const

Static Private Member Functions

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

Private Attributes

Domain m_domain
int m_fd
Type m_type

Detailed Description

Base class for sockets

Definition at line 16 of file install/include/utilmm/system/socket.hh.


Member Enumeration Documentation

Enumerator:
Unix 
Inet 
Unix 
Inet 

Definition at line 19 of file utilmm/system/socket.hh.

Enumerator:
Unix 
Inet 
Unix 
Inet 

Definition at line 19 of file install/include/utilmm/system/socket.hh.

Enumerator:
Stream 
Datagram 
Stream 
Datagram 

Definition at line 20 of file utilmm/system/socket.hh.

Enumerator:
Stream 
Datagram 
Stream 
Datagram 

Definition at line 20 of file install/include/utilmm/system/socket.hh.

Enumerator:
WaitRead 
WaitWrite 
WaitException 
WaitRead 
WaitWrite 
WaitException 

Definition at line 21 of file utilmm/system/socket.hh.

Enumerator:
WaitRead 
WaitWrite 
WaitException 
WaitRead 
WaitWrite 
WaitException 

Definition at line 21 of file install/include/utilmm/system/socket.hh.


Constructor & Destructor Documentation

utilmm::base_socket::base_socket ( int  fd  ) 

Definition at line 44 of file socket.cc.

utilmm::base_socket::base_socket ( Domain  domain,
Type  type 
)

Definition at line 46 of file socket.cc.

utilmm::base_socket::~base_socket (  ) 

Closes the socket

Definition at line 56 of file socket.cc.

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

int utilmm::base_socket::fd (  )  const

Get the socket file descriptor

Definition at line 124 of file socket.cc.

void utilmm::base_socket::flush (  )  const

Flush all buffers related to this socket

void utilmm::base_socket::flush (  )  const

Flush all buffers related to this socket

Definition at line 160 of file socket.cc.

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

Definition at line 62 of file socket.cc.

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

Definition at line 34 of file socket.cc.

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

Definition at line 24 of file socket.cc.

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

Non-blocking version of wait

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

Non-blocking version of wait

Parameters:
what an OR-ed field of values in the Wait enum
Returns:
true if the event was present and false otherwise

Definition at line 125 of file socket.cc.

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

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

Parameters:
what an OR-ed field of values in the Wait enum
int utilmm::base_socket::wait ( int  what,
timeval *  tv 
) const [private]
void utilmm::base_socket::wait ( int  what  )  const

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

Parameters:
what an OR-ed field of values in the Wait enum

Definition at line 130 of file socket.cc.

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

Definition at line 131 of file socket.cc.


Member Data Documentation

Definition at line 30 of file install/include/utilmm/system/socket.hh.

Definition at line 29 of file install/include/utilmm/system/socket.hh.

Definition at line 31 of file install/include/utilmm/system/socket.hh.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


utilmm
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Fri Jan 11 10:07:42 2013