![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "Socket.h"
Public Member Functions | |
Socket (tcp::socket &&socket) | |
virtual | ~Socket () |
virtual void | Start ()=0 |
virtual bool | Update () |
boost::asio::ip::address | GetRemoteIpAddress () const |
uint16 | GetRemotePort () const |
void | AsyncRead () |
void | AsyncReadWithCallback (void(T::*callback)(boost::system::error_code, std::size_t)) |
void | QueuePacket (MessageBuffer &&buffer) |
bool | IsOpen () const |
void | CloseSocket () |
void | DelayedCloseSocket () |
Marks the socket for closing after write buffer becomes empty. | |
MessageBuffer & | GetReadBuffer () |
Protected Member Functions | |
virtual void | OnClose () |
virtual void | ReadHandler ()=0 |
bool | AsyncProcessQueue () |
void | SetNoDelay (bool enable) |
Private Member Functions | |
void | ReadHandlerInternal (boost::system::error_code error, size_t transferredBytes) |
void | WriteHandlerWrapper (boost::system::error_code, std::size_t) |
bool | HandleQueue () |
Private Attributes | |
tcp::socket | _socket |
boost::asio::ip::address | _remoteAddress |
uint16 | _remotePort |
MessageBuffer | _readBuffer |
std::queue< MessageBuffer > | _writeQueue |
std::atomic< bool > | _closed |
std::atomic< bool > | _closing |
bool | _isWritingAsync |
References Socket< T >::_readBuffer, READ_BLOCK_SIZE, and MessageBuffer::Resize().
References Socket< T >::_closed, and Socket< T >::_socket.
|
inlineprotected |
References Socket< T >::_isWritingAsync, Socket< T >::_socket, Socket< T >::_writeQueue, MessageBuffer::GetActiveSize(), and MessageBuffer::GetReadPointer().
Referenced by Socket< T >::HandleQueue(), and Socket< T >::QueuePacket().
|
inline |
References Socket< T >::_readBuffer, Socket< T >::_socket, MessageBuffer::EnsureFreeSpace(), MessageBuffer::GetRemainingSpace(), MessageBuffer::GetWritePointer(), Socket< T >::IsOpen(), and MessageBuffer::Normalize().
|
inline |
References Socket< T >::_readBuffer, Socket< T >::_socket, MessageBuffer::EnsureFreeSpace(), MessageBuffer::GetRemainingSpace(), MessageBuffer::GetWritePointer(), Socket< T >::IsOpen(), and MessageBuffer::Normalize().
|
inline |
References Socket< T >::_closed, Socket< T >::_socket, Socket< T >::GetRemoteIpAddress(), LOG_DEBUG, and Socket< T >::OnClose().
Referenced by Socket< T >::HandleQueue(), and Socket< T >::ReadHandlerInternal().
|
inline |
|
inline |
References Socket< T >::_readBuffer.
|
inline |
References Socket< T >::_remoteAddress.
Referenced by Socket< T >::CloseSocket(), and Socket< T >::SetNoDelay().
References Socket< T >::_remotePort.
|
inlineprivate |
References Socket< T >::_closing, Socket< T >::_socket, Socket< T >::_writeQueue, Socket< T >::AsyncProcessQueue(), Socket< T >::CloseSocket(), MessageBuffer::GetActiveSize(), MessageBuffer::GetReadPointer(), and MessageBuffer::ReadCompleted().
Referenced by Socket< T >::Update(), and Socket< T >::WriteHandlerWrapper().
|
inline |
References Socket< T >::_closed, and Socket< T >::_closing.
Referenced by Socket< T >::AsyncRead(), and Socket< T >::AsyncReadWithCallback().
|
inlineprotectedvirtual |
|
inline |
References Socket< T >::_writeQueue, and Socket< T >::AsyncProcessQueue().
|
protectedpure virtual |
Implemented in AuthSession, and WorldSocket.
Referenced by Socket< T >::ReadHandlerInternal().
|
inlineprivate |
References Socket< T >::_readBuffer, Socket< T >::CloseSocket(), Socket< T >::ReadHandler(), and MessageBuffer::WriteCompleted().
|
inlineprotected |
References Socket< T >::_socket, Socket< T >::GetRemoteIpAddress(), and LOG_DEBUG.
|
pure virtual |
Implemented in AuthSession, and WorldSocket.
|
inlinevirtual |
Reimplemented in AuthSession, and WorldSocket.
References Socket< T >::_closed, Socket< T >::_closing, Socket< T >::_isWritingAsync, Socket< T >::_writeQueue, and Socket< T >::HandleQueue().
|
inlineprivate |
References Socket< T >::_isWritingAsync, and Socket< T >::HandleQueue().
|
private |
Referenced by Socket< T >::CloseSocket(), Socket< T >::IsOpen(), Socket< T >::Update(), and Socket< T >::~Socket().
|
private |
|
private |
Referenced by Socket< T >::AsyncProcessQueue(), Socket< T >::Update(), and Socket< T >::WriteHandlerWrapper().
|
private |
|
private |
Referenced by Socket< T >::GetRemoteIpAddress().
Referenced by Socket< T >::GetRemotePort().
|
private |
|
private |