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

#include <socket.hh>

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

List of all members.

Public Member Functions

void connect (std::string const &to)
void connect (std::string const &to)
int read (void *buf, size_t size) const
int read (void *buf, size_t size) const
 socket (Domain domain, Type type, std::string const &connect_to)
 socket (int fd)
 socket (Domain domain, Type type, std::string const &connect_to)
 socket (int fd)
int write (void const *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

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


Constructor & Destructor Documentation

utilmm::socket::socket ( int  fd  ) 

Creates a socket object from an already existing file descriptor

Definition at line 167 of file socket.cc.

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.

Definition at line 164 of file socket.cc.

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.

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.

Definition at line 170 of file socket.cc.

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::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

Definition at line 176 of file socket.cc.

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
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

Definition at line 183 of file socket.cc.


Friends And Related Function Documentation

server_socket [friend]

Definition at line 71 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:43 2013