#include <tcpstream.h>
Public Types | |
| enum | stream_state { TCPSTREAM_CONNECTED = 0, TCPSTREAM_HALF_CLOSED = 1, TCPSTREAM_CLOSED = 2 } |
| 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=0) | |
| virtual | ~tcpstream () |
| string | getAddress () const |
| int | getPort () const |
| void | close () |
| void | done () |
| void | enableKeepalive () |
Public Attributes | |
| stream_error | errmsg |
Static Public Attributes | |
| static const size_t | BUFF_SIZE = 2048 |
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 34 of file tcpstream.h.
Definition at line 43 of file tcpstream.h.
Definition at line 37 of file tcpstream.h.
| ibrcommon::tcpstream::tcpstream | ( | int | socket = 0 |
) |
Definition at line 19 of file tcpstream.cpp.
| ibrcommon::tcpstream::~tcpstream | ( | ) | [virtual] |
Definition at line 36 of file tcpstream.cpp.
| void ibrcommon::tcpstream::close | ( | ) |
Definition at line 63 of file tcpstream.cpp.
References _socket, TCPSTREAM_CLOSED, and TCPSTREAM_HALF_CLOSED.
Referenced by dtn::api::Client::eventError(), dtn::api::Client::eventShutdown(), dtn::api::Client::eventTimeout(), main(), term(), and ~tcpstream().
| void ibrcommon::tcpstream::done | ( | ) |
This method close the connection for writing.
Definition at line 79 of file tcpstream.cpp.
References _socket, and TCPSTREAM_HALF_CLOSED.
Referenced by dtn::api::Client::eventShutdown(), and dtn::api::Client::eventTimeout().
| void ibrcommon::tcpstream::enableKeepalive | ( | ) |
Definition at line 189 of file tcpstream.cpp.
References _socket.
Referenced by dtn::net::TCPConvergenceLayer::TCPConnection::TCPConnection().
| string ibrcommon::tcpstream::getAddress | ( | ) | const |
Definition at line 45 of file tcpstream.cpp.
References _socket.
| int ibrcommon::tcpstream::getPort | ( | ) | const |
Definition at line 54 of file tcpstream.cpp.
References _socket.
| int ibrcommon::tcpstream::overflow | ( | int | c = std::char_traits<char>::eof() |
) | [protected, virtual] |
Definition at line 95 of file tcpstream.cpp.
References _socket, BUFF_SIZE, errmsg, ERROR_EPIPE, ERROR_RESET, ERROR_WRITE, and TCPSTREAM_HALF_CLOSED.
Referenced by sync().
| int ibrcommon::tcpstream::sync | ( | ) | [protected, virtual] |
Definition at line 86 of file tcpstream.cpp.
References overflow().
| int ibrcommon::tcpstream::underflow | ( | ) | [protected, virtual] |
Definition at line 147 of file tcpstream.cpp.
References _socket, BUFF_SIZE, errmsg, ERROR_CLOSED, ERROR_EPIPE, ERROR_READ, and TCPSTREAM_CLOSED.
int ibrcommon::tcpstream::_socket [protected] |
Definition at line 77 of file tcpstream.h.
Referenced by close(), done(), enableKeepalive(), getAddress(), getPort(), overflow(), ibrcommon::tcpclient::tcpclient(), tcpstream(), underflow(), and ~tcpstream().
const size_t ibrcommon::tcpstream::BUFF_SIZE = 2048 [static] |
Definition at line 53 of file tcpstream.h.
Referenced by overflow(), tcpstream(), and underflow().
Definition at line 68 of file tcpstream.h.
Referenced by overflow(), and underflow().
1.6.3