#include <tcpstream.h>
Inherited by ibrcommon::tcpclient.
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 () |
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 () |
Protected Attributes | |
| int | _socket |
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 21 of file tcpstream.cpp.
References BUFF_SIZE.
| ibrcommon::tcpstream::~tcpstream | ( | ) | [virtual] |
Definition at line 29 of file tcpstream.cpp.
References close().

| void ibrcommon::tcpstream::close | ( | bool | errorcheck = false |
) |
Definition at line 56 of file tcpstream.cpp.
References _socket.
Referenced by main(), overflow(), term(), underflow(), and ~tcpstream().
| void ibrcommon::tcpstream::enableKeepalive | ( | ) |
Definition at line 169 of file tcpstream.cpp.
References _socket.
Referenced by dtn::net::TCPConnection::TCPConnection().
| void ibrcommon::tcpstream::enableLinger | ( | int | linger | ) |
Definition at line 178 of file tcpstream.cpp.
References _socket.
Referenced by dtn::net::TCPConnection::TCPConnection().
| void ibrcommon::tcpstream::enableNoDelay | ( | ) |
Definition at line 188 of file tcpstream.cpp.
References _socket.
Referenced by dtn::daemon::ClientHandler::ClientHandler(), main(), and dtn::net::TCPConnection::TCPConnection().
| string ibrcommon::tcpstream::getAddress | ( | ) | const |
Definition at line 38 of file tcpstream.cpp.
References _socket.
| int ibrcommon::tcpstream::getPort | ( | ) | const |
Definition at line 47 of file tcpstream.cpp.
References _socket.
| int ibrcommon::tcpstream::overflow | ( | int | c = std::char_traits<char>::eof() |
) | [protected, virtual] |
Definition at line 82 of file tcpstream.cpp.
References _socket, BUFF_SIZE, close(), errmsg, and IBRCOMMON_LOGGER_DEBUG.
Referenced by sync().

| int ibrcommon::tcpstream::sync | ( | ) | [protected, virtual] |
Definition at line 73 of file tcpstream.cpp.
References overflow().

| int ibrcommon::tcpstream::underflow | ( | ) | [protected, virtual] |
int ibrcommon::tcpstream::_socket [protected] |
Definition at line 63 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().
1.7.1