Go to the documentation of this file.
21 #ifndef POSIXDESCRIPTOR_HPP_
22 #define POSIXDESCRIPTOR_HPP_
28 #include <sys/ioctl.h>
29 #include <sys/types.h>
32 #include <sys/socket.h>
33 #include <netinet/in.h>
34 #include <netinet/ip.h>
47 #define ONPOSIX_LINUX_SPECIFIC
312 void (*handler) (
Buffer* b,
size_t size),
313 Buffer* buff,
size_t size);
316 void (*handler) (
void* b,
size_t size),
317 void* buff,
size_t size);
368 int do_read (
void* p,
size_t size);
369 int do_write (
const void* p,
size_t size);
389 DEBUG(
"Destroying descriptor...");
390 DEBUG(
"Closing desciptor...");
392 DEBUG(
"delete thread...");
396 DEBUG(
"Descriptor succesfully destroyed. Let's move on!");
416 DEBUG(
"async_read() called!");
437 inline void async_read(
void (*handler)(
void* b,
size_t size),
440 DEBUG(
"async_read() called!");
496 int read (
void* p,
size_t size);
498 int write (
const void* p,
size_t size);
499 int write (
const std::string& s);
512 DEBUG(
"Flushing pending data...")
549 ERROR(
"Bad file descriptor");
550 throw std::runtime_error(
"PosixDescriptor: error in copy constructor");
552 DEBUG(
"Creating worker (stopped)");
570 if (::dup2(src.
fd_,
fd_) < 0) {
571 ERROR(
"Bad file descriptor");
572 throw std::runtime_error(
"PosixDescriptor: error in operator=");
577 #ifdef ONPOSIX_LINUX_SPECIFIC
599 inline int ioctl(
int request,
void* argp){