Adbase
Adinf C++ base library V2
|
#include <TcpConnection.hpp>
Inherits enable_shared_from_this< TcpConnection >.
Public Member Functions | |
TcpConnection (EventBasePtr &base, int sockfd, const InetAddress &localAddr, const InetAddress &peerAddr, int connId, const RemoveConnectionCallback &removeCb) | |
~TcpConnection () | |
const InetAddress & | localAddress () const |
const InetAddress & | peerAddress () const |
void | init () |
void | eventCallback (short events) |
void | readCallback () |
void | writeCallback () |
bool | getTcpInfo (struct tcp_info *) const |
std::string | getTcpInfoString () const |
void | send (const void *message, size_t len) |
void | send (std::string &message) |
void | shutdown () |
void | setTcpNoDelay (bool on) |
void | setContext (void *data) |
void * | getContext () |
bool | connected () const |
bool | disconnected () const |
void | setMessageCallback (const MessageCallback &cb) |
void | setWriteCompleteCallback (const WriteCompleteCallback &cb) |
void | setConnectionCookiePrefix (const ConnectionCookiePrefix &cp) |
const std::string | getCookie () |
Definition at line 26 of file TcpConnection.hpp.
adbase::TcpConnection::TcpConnection | ( | EventBasePtr & | base, |
int | sockfd, | ||
const InetAddress & | localAddr, | ||
const InetAddress & | peerAddr, | ||
int | connId, | ||
const RemoveConnectionCallback & | removeCb | ||
) |
Definition at line 52 of file TcpConnection.cpp.
References adbase::Socket::fd(), and adbase::Socket::setKeepAlive().
adbase::TcpConnection::~TcpConnection | ( | ) |
Definition at line 79 of file TcpConnection.cpp.
References LOG_TRACE.
|
inline |
Definition at line 58 of file TcpConnection.hpp.
|
inline |
Definition at line 62 of file TcpConnection.hpp.
void adbase::TcpConnection::eventCallback | ( | short | events | ) |
Definition at line 156 of file TcpConnection.cpp.
References LOG_DEBUG, LOG_ERROR, and LOG_TRACE.
Referenced by adbase::detail::eventCallback().
|
inline |
Definition at line 54 of file TcpConnection.hpp.
const std::string adbase::TcpConnection::getCookie | ( | ) |
Definition at line 143 of file TcpConnection.cpp.
bool adbase::TcpConnection::getTcpInfo | ( | struct tcp_info * | tcpi | ) | const |
Definition at line 86 of file TcpConnection.cpp.
References adbase::Socket::getTcpInfo().
std::string adbase::TcpConnection::getTcpInfoString | ( | ) | const |
Definition at line 93 of file TcpConnection.cpp.
References adbase::Socket::getTcpInfoString().
void adbase::TcpConnection::init | ( | ) |
Definition at line 71 of file TcpConnection.cpp.
References adbase::detail::eventCallback(), adbase::detail::readCallback(), and adbase::detail::writeCallback().
|
inline |
Definition at line 32 of file TcpConnection.hpp.
|
inline |
Definition at line 36 of file TcpConnection.hpp.
References adbase::detail::eventCallback(), adbase::detail::readCallback(), and adbase::detail::writeCallback().
void adbase::TcpConnection::readCallback | ( | ) |
Definition at line 174 of file TcpConnection.cpp.
References LOG_TRACE, and adbase::Timestamp::now().
Referenced by adbase::detail::readCallback().
void adbase::TcpConnection::send | ( | const void * | message, |
size_t | len | ||
) |
void adbase::TcpConnection::send | ( | std::string & | message | ) |
Definition at line 117 of file TcpConnection.cpp.
References send().
|
inline |
Definition at line 72 of file TcpConnection.hpp.
|
inline |
Definition at line 50 of file TcpConnection.hpp.
|
inline |
Definition at line 66 of file TcpConnection.hpp.
void adbase::TcpConnection::setTcpNoDelay | ( | bool | on | ) |
Definition at line 136 of file TcpConnection.cpp.
References adbase::Socket::setTcpNoDelay().
|
inline |
Definition at line 69 of file TcpConnection.hpp.
void adbase::TcpConnection::shutdown | ( | ) |
Definition at line 124 of file TcpConnection.cpp.
References LOG_DEBUG, and adbase::Socket::shutdownWrite().
void adbase::TcpConnection::writeCallback | ( | ) |
Definition at line 183 of file TcpConnection.cpp.
References LOG_DEBUG, LOG_TRACE, and adbase::Socket::shutdownWrite().
Referenced by adbase::detail::writeCallback().