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

#include <utilmm/system/socket.hh>

Inheritance diagram for utilmm::socket:

utilmm::base_socket

List of all members.

Public Member Functions

 socket (int fd)
 socket (Domain domain, Type type, std::string const &connect_to)
void connect (std::string const &to)
int read (void *buf, size_t size) const
int write (void const *buf, size_t size) const

Friends

class server_socket


Detailed Description

A socket connected to a remote peer

Constructor & Destructor Documentation

utilmm::socket::socket ( int  fd  ) 

Creates a socket object from an already existing file descriptor

utilmm::socket::socket ( Domain  domain,
Type  type,
std::string const &  connect_to 
)

Opens a new socket in the specified domain and of the specified type, and connect it to connect_to. connect_to is either an IP address of the form a.b.c.d:port if domain is Inet, or a Unix socket name otherwise.


Member Function Documentation

void utilmm::socket::connect ( std::string const &  to  ) 

Connects or reconnects this socket to the specified peer. to is either an IP address of the form a.b.c.d:port if domain is Inet, or a Unix socket name otherwise.

int utilmm::socket::read ( void *  buf,
size_t  size 
) const

Reads at most size bytes in the specified buffer and returns the count of bytes actually read.

Exceptions:
unix_error raised if an error occured

int utilmm::socket::write ( void const *  buf,
size_t  size 
) const

Writes at most size bytes in the specified buffer and returns the count of bytes actually written.

Exceptions:
unix_error raised if an error occured


Friends And Related Function Documentation

friend class server_socket [friend]


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