IBR-DTNSuite  0.10
dtn::net::inotifysocket Class Reference

#include <FileMonitor.h>

Inheritance diagram for dtn::net::inotifysocket:
Inheritance graph
Collaboration diagram for dtn::net::inotifysocket:
Collaboration graph

Public Member Functions

 inotifysocket ()
 
virtual ~inotifysocket ()
 
virtual void up () throw (ibrcommon::socket_exception)
 
virtual void down () throw (ibrcommon::socket_exception)
 
void watch (const ibrcommon::File &path, int opts) throw (ibrcommon::socket_exception)
 
ssize_t read (char *data, size_t len) throw (ibrcommon::socket_exception)
 

Additional Inherited Members

- Private 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)
 
 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)
 
- Static Private 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 Private Attributes inherited from ibrcommon::basesocket
static int DEFAULT_SOCKET_FAMILY = AF_INET6
 
static int DEFAULT_SOCKET_FAMILY_ALTERNATIVE = AF_INET
 

Detailed Description

Definition at line 36 of file FileMonitor.h.

Constructor & Destructor Documentation

dtn::net::inotifysocket::inotifysocket ( )

Definition at line 37 of file FileMonitor.cpp.

dtn::net::inotifysocket::~inotifysocket ( )
virtual

Definition at line 41 of file FileMonitor.cpp.

Member Function Documentation

void dtn::net::inotifysocket::down ( ) throw (ibrcommon::socket_exception)
virtual

Close and destroy the file descriptor of this socket assignment.

Exceptions
socket_exceptionif the action has failed

Implements ibrcommon::basesocket.

Definition at line 58 of file FileMonitor.cpp.

References ibrcommon::basesocket::_state, ibrcommon::basesocket::close(), ibrcommon::basesocket::fd(), ibrcommon::basesocket::SOCKET_DOWN, and ibrcommon::basesocket::SOCKET_UP.

Here is the call graph for this function:

ssize_t dtn::net::inotifysocket::read ( char *  data,
size_t  len 
) throw (ibrcommon::socket_exception)

Definition at line 85 of file FileMonitor.cpp.

Referenced by dtn::net::FileMonitor::componentRun().

void dtn::net::inotifysocket::up ( ) throw (ibrcommon::socket_exception)
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.

Definition at line 45 of file FileMonitor.cpp.

References ibrcommon::basesocket::_fd, ibrcommon::basesocket::_state, ibrcommon::basesocket::SOCKET_DOWN, and ibrcommon::basesocket::SOCKET_UP.

void dtn::net::inotifysocket::watch ( const ibrcommon::File path,
int  opts 
) throw (ibrcommon::socket_exception)

Definition at line 77 of file FileMonitor.cpp.

Referenced by dtn::net::FileMonitor::watch().


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