#include <vsocket.h>
Inherits ibrcommon::LinkManager::EventCallback.

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) |
Definition at line 44 of file vsocket.h.
| 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().

| void ibrcommon::vsocket::add | ( | const int | fd | ) |
Definition at line 150 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 126 of file vsocket.cpp.
Referenced by add(), bind(), ibrcommon::UnicastSocket::bind(), ibrcommon::tcpserver::bind(), close(), dtn::net::IPNDAgent::componentUp(), get(), listen(), set(), shutdown(), ibrcommon::tcpserver::tcpserver(), and unset().
| void ibrcommon::vsocket::bind | ( | const vinterface & | iface, | |
| const int | port, | |||
| unsigned int | socktype = SOCK_STREAM | |||
| ) |
Definition at line 69 of file vsocket.cpp.
References bind(), ibrcommon::vinterface::empty(), ibrcommon::vinterface::getAddresses(), ibrcommon::LinkManager::getInstance(), and ibrcommon::LinkManager::registerInterfaceEvent().

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

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

| 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().

| 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().

| 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().

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

| 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().

| 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().

| void ibrcommon::vsocket::shutdown | ( | ) |
Definition at line 207 of file vsocket.cpp.
References bind().
Referenced by dtn::net::IPNDAgent::componentDown(), and ibrcommon::tcpserver::shutdown().

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

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

| 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().

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

| 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.
| sock | ||
| timeout |
| int sendto | ( | ibrcommon::vsocket & | sock, | |
| const void * | buf, | |||
| size_t | n, | |||
| const ibrcommon::vaddress & | address, | |||
| const unsigned int | port | |||
| ) | [friend] |
1.7.1