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

#include <utilmm/system/socket.hh>

Inheritance diagram for utilmm::base_socket:

utilmm::server_socket utilmm::socket

List of all members.

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

Classes

struct  bad_address


Detailed Description

Base class for sockets

Member Enumeration Documentation

enum utilmm::base_socket::Domain

Enumerator:
Unix 
Inet 

enum utilmm::base_socket::Type

Enumerator:
Stream 
Datagram 

enum utilmm::base_socket::Wait

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

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

int utilmm::base_socket::fd (  )  const

Get the socket file descriptor

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

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

void utilmm::base_socket::flush (  )  const

Flush all buffers related to this socket


The documentation for this class was generated from the following file:
Generated on Tue Feb 19 10:51:01 2008 for Util-- by doxygen 1.5.3
SourceForge.net Project Page