Combine of Socket Connection data. More...
#include <TcpConnection.h>
Public Types | |
| enum class | State { Disconnected = 0 , Connecting = 1 , Connected = 2 , Disconnecting = 3 } |
Public Member Functions | |
| TcpConnection (EventLoop *ioLoop, const std::string &name, SOCKET socketFd, const InetAddress &localAddress, const InetAddress &peerAddress) | |
| Constructor Function. | |
| virtual | ~TcpConnection () |
| Destructor Function. | |
| TcpConnection (const TcpConnection &)=delete | |
| Copy Constructor Function. | |
| TcpConnection & | operator= (const TcpConnection &)=delete |
| Copy Assignment Operation. | |
| EventLoop * | GetLoop () const |
| Get this TcpConnection IO EventLoop. | |
| const std::string & | GetName () const |
| Get this TcpConnection name. | |
| const InetAddress & | LocalAddress () const |
| Get this TcpConnection LocalAddress. | |
| const InetAddress & | PeerAddress () const |
| Get this TcpConnection PeerAddress. | |
| bool | Connected () const |
| Determined if this TcpConnection is connected. | |
| void | Send (const std::string &buffer) |
| Send message to socket. | |
| void | ShutDown () |
| ShutDown socket. | |
| void | SetConnectionCallback (const DelegateConnectionCallback &cb) |
| Set ConnectionCallback. | |
| void | SetMessageCallback (const DelegateMessageCallback &cb) |
| Set MessageCallback. | |
| void | SetWriteCompleteCallback (const DelegateWriteCompleteCallback &cb) |
| Set WriteCompleteCallback. | |
| void | SetHighWaterMarkCallback (const DelegateHighWaterMarkCallback &cb) |
| Set HighWaterMarkCallback. | |
| void | SetCloseCallback (const DelegateCloseCallback &cb) |
| Set CloseCallback. | |
| void | ConnectEstablished () |
| void | ConnectDestroyed () |
Private Member Functions | |
| void | SetState (State state) |
| void | HandleRead () |
| Handle Read event. | |
| void | HandleWrite () |
| Handle Write event. | |
| void | HandleClose () |
| Handle Close event. | |
| void | HandleError () const |
| Handle Error event. | |
| void | SendInLoop (const char *message, size_t len) |
| Send message to socket. | |
| void | ShutDownInLoop () const |
| ShutDown socket. | |
Private Attributes | |
| EventLoop * | m_IoLoop |
| io Loop from TcpServer::NewConnection. | |
| std::string | m_Name |
| TcpConnection name. | |
| std::atomic< State > | m_State |
| TcpConnection state. | |
| std::unique_ptr< Socket > | m_Socket |
| TcpConnection socket. | |
| std::unique_ptr< Channel > | m_Channel |
| TcpConnection channel. | |
| InetAddress | m_LocalAddress |
| TcpConnection LocalAddress. | |
| InetAddress | m_PeerAddress |
| TcpConnection PeerAddress. | |
| DelegateConnectionCallback | m_ConnectionCallback |
| DelegateConnectionCallback. | |
| DelegateMessageCallback | m_MessageCallback |
| DelegateMessageCallback. | |
| DelegateWriteCompleteCallback | m_WriteCompleteCallback |
| DelegateWriteCompleteCallback. | |
| DelegateHighWaterMarkCallback | m_HighWaterMarkCallback |
| DelegateHighWaterMarkCallback. | |
| DelegateCloseCallback | m_CloseCallback |
| DelegateCloseCallback. | |
| Buffer | m_InputBuffer |
| Input Buffer. | |
| Buffer | m_OutputBuffer |
| Output Buffer. | |
Combine of Socket Connection data.
Definition at line 24 of file TcpConnection.h.