|
IBR-DTNSuite 0.6
|
#include <vsocket.h>


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 | relisten () |
| void | set (const Option &o) |
| void | unset (const Option &o) |
| void | close () |
| void | shutdown () |
| int | fd () |
| void | select (std::list< int > &fds, struct timeval *tv=NULL) |
| int | sendto (const void *buf, size_t n, const ibrcommon::vaddress &address, const unsigned int port) |
| void | eventNotify (const LinkManagerEvent &evt) |
| void | setEventCallback (ibrcommon::LinkManager::EventCallback *cb) |
Static Public Member Functions | |
| static void | set_non_blocking (int socket, bool nonblock=true) |
| ibrcommon::vsocket::vsocket | ( | ) |
Definition at line 45 of file vsocket.cpp.
References set_non_blocking().

| ibrcommon::vsocket::~vsocket | ( | ) | [virtual] |
Definition at line 60 of file vsocket.cpp.
References ibrcommon::LinkManager::getInstance(), and ibrcommon::LinkManager::unregisterAllEvents().

| void ibrcommon::vsocket::add | ( | const int | fd | ) |
Definition at line 186 of file vsocket.cpp.
References bind().
Referenced by ibrcommon::NetLinkManager::run().

| int ibrcommon::vsocket::bind | ( | const vaddress & | address, |
| const int | port, | ||
| unsigned int | socktype = SOCK_STREAM |
||
| ) |
Definition at line 150 of file vsocket.cpp.
Referenced by add(), bind(), ibrcommon::UnicastSocket::bind(), ibrcommon::tcpserver::bind(), close(), dtn::net::IPNDAgent::componentUp(), eventNotify(), get(), listen(), select(), sendto(), set(), shutdown(), ibrcommon::tcpserver::tcpserver(), and unset().
| int ibrcommon::vsocket::bind | ( | const int | port, |
| unsigned int | socktype = SOCK_STREAM |
||
| ) |
Definition at line 138 of file vsocket.cpp.
References bind().

| int ibrcommon::vsocket::bind | ( | const ibrcommon::File & | file, |
| unsigned int | socktype = SOCK_STREAM |
||
| ) |
Definition at line 156 of file vsocket.cpp.
References bind().

| void ibrcommon::vsocket::bind | ( | const vinterface & | iface, |
| const int | port, | ||
| unsigned int | socktype = SOCK_STREAM |
||
| ) |
Definition at line 89 of file vsocket.cpp.
References bind(), ibrcommon::vinterface::empty(), ibrcommon::vinterface::getAddresses(), ibrcommon::LinkManager::getInstance(), and ibrcommon::LinkManager::registerInterfaceEvent().

| void ibrcommon::vsocket::close | ( | ) |
Definition at line 239 of file vsocket.cpp.
References bind().
Referenced by ibrcommon::NetLinkManager::__cancellation(), dtn::net::IPNDAgent::__cancellation(), ibrcommon::tcpserver::close(), ibrcommon::udpsocket::shutdown(), and ibrcommon::udpsocket::~udpsocket().

| void ibrcommon::vsocket::eventNotify | ( | const LinkManagerEvent & | evt | ) | [virtual] |
Implements ibrcommon::LinkManager::EventCallback.
Definition at line 272 of file vsocket.cpp.
References bind(), ibrcommon::LinkManagerEvent::EVENT_ADDRESS_ADDED, ibrcommon::LinkManagerEvent::EVENT_ADDRESS_REMOVED, ibrcommon::LinkManager::EventCallback::eventNotify(), ibrcommon::LinkManagerEvent::getAddress(), ibrcommon::LinkManagerEvent::getInterface(), ibrcommon::LinkManagerEvent::getType(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, ibrcommon::vaddress::toString(), ibrcommon::vinterface::toString(), unbind(), and ibrcommon::Exception::what().

| int ibrcommon::vsocket::fd | ( | ) |
Definition at line 266 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 315 of file vsocket.cpp.
References bind(), and ibrcommon::vaddress::VADDRESS_UNSPEC.
Referenced by ibrcommon::udpsocket::send().

| const std::list< int > ibrcommon::vsocket::get | ( | const ibrcommon::vaddress::Family | f = vaddress::VADDRESS_UNSPEC | ) |
Definition at line 333 of file vsocket.cpp.
References bind(), and ibrcommon::vaddress::VADDRESS_UNSPEC.

| void ibrcommon::vsocket::listen | ( | int | connections | ) |
Definition at line 192 of file vsocket.cpp.
References bind().
Referenced by ibrcommon::tcpserver::bind(), ibrcommon::tcpserver::listen(), and relisten().

| void ibrcommon::vsocket::relisten | ( | ) |
Definition at line 205 of file vsocket.cpp.
References listen().
Referenced by select().

| void ibrcommon::vsocket::select | ( | std::list< int > & | fds, |
| struct timeval * | tv = NULL |
||
| ) |
Definition at line 409 of file vsocket.cpp.
References bind(), ibrcommon::Queue< T >::empty(), ibrcommon::Queue< T >::exclusive(), ibrcommon::Queue< T >::Locked::front(), IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, ibrcommon::Queue< T >::Locked::pop(), and relisten().
Referenced by ibrcommon::tcpserver::accept(), dtn::net::IPNDAgent::componentRun(), ibrcommon::udpsocket::receive(), and ibrcommon::NetLinkManager::run().

| int ibrcommon::vsocket::sendto | ( | const void * | buf, |
| size_t | n, | ||
| const ibrcommon::vaddress & | address, | ||
| const unsigned int | port | ||
| ) |
Definition at line 348 of file vsocket.cpp.
References ibrcommon::vaddress::addrinfo(), bind(), ibrcommon::vaddress::getFamily(), IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, and ibrcommon::vaddress::toString().

| void ibrcommon::vsocket::set | ( | const Option & | o | ) |
Definition at line 211 of file vsocket.cpp.
References bind().
Referenced by ibrcommon::tcpserver::bind(), and dtn::net::IPNDAgent::IPNDAgent().

| void ibrcommon::vsocket::set_non_blocking | ( | int | socket, |
| bool | nonblock = true |
||
| ) | [static] |
Definition at line 27 of file vsocket.cpp.
Referenced by ibrcommon::tcpstream::select(), ibrcommon::tcpstream::tcpstream(), and vsocket().
| void ibrcommon::vsocket::setEventCallback | ( | ibrcommon::LinkManager::EventCallback * | cb | ) |
Definition at line 310 of file vsocket.cpp.
Referenced by dtn::net::IPNDAgent::componentDown(), and dtn::net::IPNDAgent::componentUp().
| void ibrcommon::vsocket::shutdown | ( | ) |
Definition at line 253 of file vsocket.cpp.
References bind().
Referenced by dtn::net::IPNDAgent::componentDown(), and ibrcommon::tcpserver::shutdown().

| void ibrcommon::vsocket::unbind | ( | const vinterface & | iface, |
| const int | port | ||
| ) |
Definition at line 121 of file vsocket.cpp.
References ibrcommon::vinterface::getAddresses(), ibrcommon::LinkManager::getInstance(), unbind(), and ibrcommon::LinkManager::unregisterInterfaceEvent().

| void ibrcommon::vsocket::unbind | ( | const ibrcommon::File & | file | ) |
Definition at line 174 of file vsocket.cpp.
References ibrcommon::Queue< T >::push().

| void ibrcommon::vsocket::unbind | ( | const vaddress & | address, |
| const int | port | ||
| ) |
Definition at line 162 of file vsocket.cpp.
References ibrcommon::Queue< T >::push().
Referenced by eventNotify(), and unbind().

| void ibrcommon::vsocket::unbind | ( | const int | port | ) |
Definition at line 144 of file vsocket.cpp.
References unbind().

| void ibrcommon::vsocket::unset | ( | const Option & | o | ) |
Definition at line 225 of file vsocket.cpp.
References bind().
