IBR-DTNSuite  0.10
ibrcommon::datagramsocket Class Referenceabstract

#include <socket.h>

Inheritance diagram for ibrcommon::datagramsocket:
Inheritance graph
Collaboration diagram for ibrcommon::datagramsocket:
Collaboration graph

Public Member Functions

virtual ~datagramsocket ()=0
 
virtual void up ()=0 throw (socket_exception)
 
virtual void down ()=0 throw (socket_exception)
 
virtual ssize_t recvfrom (char *buf, size_t buflen, int flags, ibrcommon::vaddress &addr) throw (socket_exception)
 
virtual void sendto (const char *buf, size_t buflen, int flags, const ibrcommon::vaddress &addr) throw (socket_exception)
 
- Public Member Functions inherited from ibrcommon::basesocket
virtual ~basesocket ()=0
 
virtual int fd () const throw (socket_exception)
 
virtual int release () throw (socket_exception)
 
void close () throw (socket_exception)
 
void shutdown (int how) throw (socket_exception)
 
bool ready () const
 
sa_family_t get_family () const throw (socket_exception)
 

Protected Member Functions

 datagramsocket ()
 
 datagramsocket (int fd)
 
- Protected Member Functions inherited from ibrcommon::basesocket
 basesocket ()
 
 basesocket (int fd)
 
void check_socket_error (const int err) const throw (socket_exception)
 
void check_bind_error (const int err, const std::string &msg="") const throw (socket_exception)
 
void set_blocking_mode (bool val, int fd=-1) const throw (socket_exception)
 
void set_keepalive (bool val, int fd=-1) const throw (socket_exception)
 
void set_linger (bool val, int l=1, int fd=-1) const throw (socket_exception)
 
void set_reuseaddr (bool val, int fd=-1) const throw (socket_exception)
 
void set_nodelay (bool val, int fd=-1) const throw (socket_exception)
 
void init_socket (const vaddress &addr, int type, int protocol) throw (socket_exception)
 
void init_socket (int domain, int type, int protocol) throw (socket_exception)
 
void bind (int fd, struct sockaddr *addr, socklen_t len) throw (socket_exception)
 

Additional Inherited Members

- Static Public Member Functions inherited from ibrcommon::basesocket
static sa_family_t get_family (int fd) throw (socket_exception)
 
static bool hasSupport (const sa_family_t family, const int type=SOCK_DGRAM, const int protocol=0) throw ()
 
- Static Public Attributes inherited from ibrcommon::basesocket
static int DEFAULT_SOCKET_FAMILY = AF_INET6
 
static int DEFAULT_SOCKET_FAMILY_ALTERNATIVE = AF_INET
 
- Protected Types inherited from ibrcommon::basesocket
enum  socketstate { SOCKET_DOWN, SOCKET_UP, SOCKET_UNMANAGED, SOCKET_DESTROYED }
 
- Protected Attributes inherited from ibrcommon::basesocket
socketstate _state
 
int _fd
 
sa_family_t _family
 

Detailed Description

Definition at line 255 of file socket.h.

Constructor & Destructor Documentation

ibrcommon::datagramsocket::~datagramsocket ( )
pure virtual

Definition at line 408 of file socket.cpp.

ibrcommon::datagramsocket::datagramsocket ( )
protected

Definition at line 399 of file socket.cpp.

ibrcommon::datagramsocket::datagramsocket ( int  fd)
protected

Definition at line 403 of file socket.cpp.

Member Function Documentation

virtual void ibrcommon::datagramsocket::down ( ) throw (socket_exception)
pure virtual

Close and destroy the file descriptor of this socket assignment.

Exceptions
socket_exceptionif the action has failed

Implements ibrcommon::basesocket.

Implemented in ibrcommon::multicastsocket, ibrcommon::udpsocket, and ibrcommon::lowpansocket.

ssize_t ibrcommon::datagramsocket::recvfrom ( char *  buf,
size_t  buflen,
int  flags,
ibrcommon::vaddress addr 
) throw (socket_exception)
virtual
void ibrcommon::datagramsocket::sendto ( const char *  buf,
size_t  buflen,
int  flags,
const ibrcommon::vaddress addr 
) throw (socket_exception)
virtual

Reimplemented in ibrcommon::lowpansocket.

Definition at line 434 of file socket.cpp.

virtual void ibrcommon::datagramsocket::up ( ) throw (socket_exception)
pure virtual

Create the file descriptor for this socket and bind to the interface if necessary.

Exceptions
socket_exceptionif the action has failed

Implements ibrcommon::basesocket.

Implemented in ibrcommon::multicastsocket, ibrcommon::udpsocket, and ibrcommon::lowpansocket.


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