Classes | Public Types | Public Member Functions | Friends

ibrcommon::vsocket Class Reference

#include <vsocket.h>

Inherits ibrcommon::LinkManager::EventCallback.

Collaboration diagram for ibrcommon::vsocket:
Collaboration graph
[legend]

List of all members.

Classes

class  vbind

Public Types

enum  Option {
  VSOCKET_REUSEADDR = 1 << 0, VSOCKET_LINGER = 1 << 1, VSOCKET_NODELAY = 1 << 2, VSOCKET_BROADCAST = 1 << 3,
  VSOCKET_NONBLOCKING = 1 << 4, VSOCKET_MULTICAST = 1 << 5, VSOCKET_MULTICAST_V6 = 1 << 6
}

Public Member Functions

 vsocket ()
virtual ~vsocket ()
int bind (const vaddress &address, const int port, unsigned int socktype=SOCK_STREAM)
void bind (const vinterface &iface, const int port, unsigned int socktype=SOCK_STREAM)
int bind (const int port, unsigned int socktype=SOCK_STREAM)
int bind (const ibrcommon::File &file, unsigned int socktype=SOCK_STREAM)
void unbind (const vaddress &address, const int port)
void unbind (const vinterface &iface, const int port)
void unbind (const int port)
void unbind (const ibrcommon::File &file)
void add (const int fd)
const std::list< int > get (const ibrcommon::vinterface &iface, const ibrcommon::vaddress::Family f=vaddress::VADDRESS_UNSPEC)
const std::list< int > get (const ibrcommon::vaddress::Family f=vaddress::VADDRESS_UNSPEC)
void listen (int connections)
void set (const Option &o)
void unset (const Option &o)
void close ()
void shutdown ()
int fd ()
void eventInterfaceChanged (const vinterface &iface)

Friends

void interrupt (ibrcommon::vsocket &sock, ibrcommon::Thread &th)
void select (ibrcommon::vsocket &sock, std::list< int > &fds, struct timespec *tv)
int sendto (ibrcommon::vsocket &sock, const void *buf, size_t n, const ibrcommon::vaddress &address, const unsigned int port)

Detailed Description

Definition at line 44 of file vsocket.h.


Member Enumeration Documentation

Enumerator:
VSOCKET_REUSEADDR 
VSOCKET_LINGER 
VSOCKET_NODELAY 
VSOCKET_BROADCAST 
VSOCKET_NONBLOCKING 
VSOCKET_MULTICAST 
VSOCKET_MULTICAST_V6 

Definition at line 52 of file vsocket.h.


Constructor & Destructor Documentation

ibrcommon::vsocket::vsocket (  ) 

Definition at line 27 of file vsocket.cpp.

ibrcommon::vsocket::~vsocket (  )  [virtual]

Definition at line 31 of file vsocket.cpp.

References ibrcommon::LinkManager::getInstance(), and ibrcommon::LinkManager::unregisterAllEvents().

Here is the call graph for this function:


Member Function Documentation

void ibrcommon::vsocket::add ( const int  fd  ) 

Definition at line 150 of file vsocket.cpp.

References bind().

Referenced by ibrcommon::NetLinkManager::run().

Here is the call graph for this function:

int ibrcommon::vsocket::bind ( const vaddress address,
const int  port,
unsigned int  socktype = SOCK_STREAM 
)
void ibrcommon::vsocket::bind ( const vinterface iface,
const int  port,
unsigned int  socktype = SOCK_STREAM 
)
int ibrcommon::vsocket::bind ( const ibrcommon::File file,
unsigned int  socktype = SOCK_STREAM 
)

Definition at line 132 of file vsocket.cpp.

References bind().

Here is the call graph for this function:

int ibrcommon::vsocket::bind ( const int  port,
unsigned int  socktype = SOCK_STREAM 
)

Definition at line 114 of file vsocket.cpp.

References bind().

Here is the call graph for this function:

void ibrcommon::vsocket::close (  ) 

Definition at line 195 of file vsocket.cpp.

References bind().

Referenced by ibrcommon::tcpserver::close(), ibrcommon::udpsocket::shutdown(), and ibrcommon::udpsocket::~udpsocket().

Here is the call graph for this function:

void ibrcommon::vsocket::eventInterfaceChanged ( const vinterface iface  )  [virtual]

Implements ibrcommon::LinkManager::EventCallback.

Definition at line 226 of file vsocket.cpp.

References IBRCOMMON_LOGGER_DEBUG, and ibrcommon::vinterface::toString().

Here is the call graph for this function:

int ibrcommon::vsocket::fd (  ) 

Definition at line 220 of file vsocket.cpp.

const std::list< int > ibrcommon::vsocket::get ( const ibrcommon::vinterface iface,
const ibrcommon::vaddress::Family  f = vaddress::VADDRESS_UNSPEC 
)

Definition at line 231 of file vsocket.cpp.

References bind(), and ibrcommon::vaddress::VADDRESS_UNSPEC.

Referenced by dtn::net::IPNDAgent::componentUp(), and ibrcommon::udpsocket::send().

Here is the call graph for this function:

const std::list< int > ibrcommon::vsocket::get ( const ibrcommon::vaddress::Family  f = vaddress::VADDRESS_UNSPEC  ) 

Definition at line 249 of file vsocket.cpp.

References bind(), and ibrcommon::vaddress::VADDRESS_UNSPEC.

Here is the call graph for this function:

void ibrcommon::vsocket::listen ( int  connections  ) 

Definition at line 156 of file vsocket.cpp.

References bind().

Referenced by ibrcommon::tcpserver::bind(), and ibrcommon::tcpserver::listen().

Here is the call graph for this function:

void ibrcommon::vsocket::set ( const Option o  ) 

Definition at line 167 of file vsocket.cpp.

References bind().

Referenced by ibrcommon::tcpserver::bind(), and dtn::net::IPNDAgent::IPNDAgent().

Here is the call graph for this function:

void ibrcommon::vsocket::shutdown (  ) 

Definition at line 207 of file vsocket.cpp.

References bind().

Referenced by dtn::net::IPNDAgent::componentDown(), and ibrcommon::tcpserver::shutdown().

Here is the call graph for this function:

void ibrcommon::vsocket::unbind ( const int  port  ) 

Definition at line 120 of file vsocket.cpp.

References unbind().

Here is the call graph for this function:

void ibrcommon::vsocket::unbind ( const vinterface iface,
const int  port 
)
void ibrcommon::vsocket::unbind ( const vaddress address,
const int  port 
)

Definition at line 138 of file vsocket.cpp.

Referenced by unbind().

void ibrcommon::vsocket::unbind ( const ibrcommon::File file  ) 

Definition at line 144 of file vsocket.cpp.

References unbind().

Here is the call graph for this function:

void ibrcommon::vsocket::unset ( const Option o  ) 

Definition at line 181 of file vsocket.cpp.

References bind().

Here is the call graph for this function:


Friends And Related Function Documentation

void interrupt ( ibrcommon::vsocket sock,
ibrcommon::Thread th 
) [friend]
void select ( ibrcommon::vsocket sock,
std::list< int > &  fds,
struct timespec *  tv 
) [friend]

Accept an incoming connection on a vsocket.

Parameters:
sock 
timeout 
Returns:
A socket file descriptor.
int sendto ( ibrcommon::vsocket sock,
const void *  buf,
size_t  n,
const ibrcommon::vaddress address,
const unsigned int  port 
) [friend]

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