IBR-DTNSuite  0.10
ibrcommon::vsocket Class Reference

#include <vsocket.h>

Collaboration diagram for ibrcommon::vsocket:
Collaboration graph

Public Member Functions

 vsocket ()
 
virtual ~vsocket ()
 
void add (basesocket *socket)
 
void add (basesocket *socket, const vinterface &iface)
 
void remove (basesocket *socket)
 
size_t size () const
 
socketset getAll () const
 
socketset get (const vinterface &iface) const
 
void destroy ()
 
void clear ()
 
void up () throw (socket_exception)
 
void down () throw ()
 
void select (socketset *readset, socketset *writeset, socketset *errorset, struct timeval *tv=NULL) throw (socket_exception)
 

Detailed Description

Definition at line 58 of file vsocket.h.

Constructor & Destructor Documentation

ibrcommon::vsocket::vsocket ( )

Constructor

Definition at line 450 of file vsocket.cpp.

ibrcommon::vsocket::~vsocket ( )
virtual

Destructor

Definition at line 456 of file vsocket.cpp.

Member Function Documentation

void ibrcommon::vsocket::add ( basesocket socket,
const vinterface iface 
)

Add a socket to the list monitored sockets. This socket instance will be adapted and destroyed on the destruction of the vsocket instance. The socket will be shutdown if the state of the given interface changes.

Parameters
socketSocket object to add
ifaceThe interface to connect this socket to

Definition at line 467 of file vsocket.cpp.

void ibrcommon::vsocket::clear ( )

clear the socketset

Definition at line 492 of file vsocket.cpp.

socketset ibrcommon::vsocket::get ( const vinterface iface) const

Get all sockets bound to a specific interface

Parameters
ifaceThe selected interface
Returns
A socketset with all sockets bound to a specific interface

Definition at line 517 of file vsocket.cpp.

Referenced by dtn::net::IPNDAgent::eventNotify(), dtn::net::UDPConvergenceLayer::eventNotify(), and dtn::net::TCPConvergenceLayer::eventNotify().

socketset ibrcommon::vsocket::getAll ( ) const
void ibrcommon::vsocket::remove ( basesocket socket)

Remove the socket from the socket list.

Parameters
socketPointer to the socket in the list

Definition at line 474 of file vsocket.cpp.

Referenced by dtn::net::IPNDAgent::eventNotify(), dtn::net::UDPConvergenceLayer::eventNotify(), dtn::net::TCPConvergenceLayer::eventNotify(), and ibrcommon::tcpsocket::up().

size_t ibrcommon::vsocket::size ( ) const

get the number of added sockets

Returns
the size of the internal socketset

Definition at line 487 of file vsocket.cpp.

Referenced by ibrcommon::tcpsocket::up().


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