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

Classes | |
| class | select_exception |
Public Types | |
| enum | stream_error { ERROR_NONE = 0, ERROR_EPIPE = 1, ERROR_CLOSED = 2, ERROR_WRITE = 3, ERROR_READ = 4, ERROR_RESET = 5 } |
Public Member Functions | |
| tcpstream (int socket=-1) | |
| virtual | ~tcpstream () |
| string | getAddress () const |
| int | getPort () const |
| void | close (bool errorcheck=false) |
| void | enableKeepalive () |
| void | enableLinger (int linger) |
| void | enableNoDelay () |
| void | setTimeout (unsigned int value) |
Public Attributes | |
| stream_error | errmsg |
Static Public Attributes | |
| static const size_t | BUFF_SIZE = 5120 |
Protected Member Functions | |
| virtual int | sync () |
| virtual int | overflow (int=std::char_traits< char >::eof()) |
| virtual int | underflow () |
| void | interrupt () |
| int | select (int int_pipe, bool &read, bool &write, bool &error, int timeout=0) throw (select_exception) |
Protected Attributes | |
| int | _socket |
| int | _interrupt_pipe_read [2] |
| int | _interrupt_pipe_write [2] |
Definition at line 28 of file tcpstream.h.
Definition at line 31 of file tcpstream.h.
| ibrcommon::tcpstream::tcpstream | ( | int | socket = -1 | ) |
Definition at line 24 of file tcpstream.cpp.
References _interrupt_pipe_read, _interrupt_pipe_write, BUFF_SIZE, and ibrcommon::vsocket::set_non_blocking().

| ibrcommon::tcpstream::~tcpstream | ( | ) | [virtual] |
Definition at line 52 of file tcpstream.cpp.
References close().

| void ibrcommon::tcpstream::close | ( | bool | errorcheck = false | ) |
Definition at line 85 of file tcpstream.cpp.
References _socket, and interrupt().
Referenced by main(), overflow(), term(), underflow(), dtn::api::Client::~Client(), and ~tcpstream().

| void ibrcommon::tcpstream::enableKeepalive | ( | ) |
Definition at line 371 of file tcpstream.cpp.
References _socket.
Referenced by dtn::net::TCPConnection::TCPConnection().
| void ibrcommon::tcpstream::enableLinger | ( | int | linger | ) |
Definition at line 380 of file tcpstream.cpp.
References _socket.
Referenced by dtn::net::TCPConnection::TCPConnection().
| void ibrcommon::tcpstream::enableNoDelay | ( | ) |
Definition at line 390 of file tcpstream.cpp.
References _socket.
Referenced by dtn::api::ClientHandler::ClientHandler(), main(), and dtn::net::TCPConnection::TCPConnection().
| string ibrcommon::tcpstream::getAddress | ( | ) | const |
Definition at line 61 of file tcpstream.cpp.
References _socket.
| int ibrcommon::tcpstream::getPort | ( | ) | const |
Definition at line 70 of file tcpstream.cpp.
References _socket.
| void ibrcommon::tcpstream::interrupt | ( | ) | [protected] |
Definition at line 79 of file tcpstream.cpp.
References _interrupt_pipe_read, and _interrupt_pipe_write.
Referenced by close().
| int ibrcommon::tcpstream::overflow | ( | int | c = std::char_traits<char>::eof() | ) | [protected, virtual] |
Definition at line 236 of file tcpstream.cpp.
References _interrupt_pipe_write, _socket, BUFF_SIZE, close(), errmsg, ERROR_EPIPE, ERROR_RESET, ERROR_WRITE, IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, and select().
Referenced by sync().

| int ibrcommon::tcpstream::select | ( | int | int_pipe, |
| bool & | read, | ||
| bool & | write, | ||
| bool & | error, | ||
| int | timeout = 0 |
||
| ) | throw (select_exception) [protected] |
Definition at line 117 of file tcpstream.cpp.
References IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, and ibrcommon::vsocket::set_non_blocking().
Referenced by overflow(), and underflow().

| void ibrcommon::tcpstream::setTimeout | ( | unsigned int | value | ) |
Definition at line 366 of file tcpstream.cpp.
| int ibrcommon::tcpstream::sync | ( | ) | [protected, virtual] |
Definition at line 108 of file tcpstream.cpp.
References overflow().

| int ibrcommon::tcpstream::underflow | ( | ) | [protected, virtual] |
Definition at line 318 of file tcpstream.cpp.
References _interrupt_pipe_read, _socket, BUFF_SIZE, close(), errmsg, ERROR_CLOSED, ERROR_EPIPE, ERROR_READ, IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, and select().

int ibrcommon::tcpstream::_interrupt_pipe_read[2] [protected] |
Definition at line 86 of file tcpstream.h.
Referenced by interrupt(), tcpstream(), and underflow().
int ibrcommon::tcpstream::_interrupt_pipe_write[2] [protected] |
Definition at line 87 of file tcpstream.h.
Referenced by interrupt(), overflow(), and tcpstream().
int ibrcommon::tcpstream::_socket [protected] |
Definition at line 66 of file tcpstream.h.
Referenced by close(), enableKeepalive(), enableLinger(), enableNoDelay(), getAddress(), getPort(), ibrcommon::tcpclient::open(), overflow(), and underflow().
const size_t ibrcommon::tcpstream::BUFF_SIZE = 5120 [static] |
Definition at line 42 of file tcpstream.h.
Referenced by overflow(), tcpstream(), and underflow().
Definition at line 52 of file tcpstream.h.
Referenced by overflow(), and underflow().