Public Member Functions | Friends
utilmm::socket Class Reference

#include <socket.hh>

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

List of all members.

Public Member Functions

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


Constructor & Destructor Documentation

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.


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.

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_errorraised 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_errorraised if an error occured

Definition at line 183 of file socket.cc.


Friends And Related Function Documentation

friend class server_socket [friend]

Definition at line 71 of file socket.hh.


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


utilmm
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Mon Oct 6 2014 03:17:01