![]() |
TrinityCore
|
#include <Socket.h>
Inheritance diagram for Trinity::Net::Socket< Stream >:Public Member Functions | |
| template<typename... Args> | |
| Socket (IoContextTcpSocket &&socket, Args &&... args) | |
| template<typename... Args> | |
| Socket (boost::asio::io_context &context, Args &&... args) | |
| Socket (Socket const &other)=delete | |
| Socket (Socket &&other)=delete | |
| Socket & | operator= (Socket const &other)=delete |
| Socket & | operator= (Socket &&other)=delete |
| virtual | ~Socket () |
| virtual void | Start () |
| virtual bool | Update () |
| boost::asio::ip::address const & | GetRemoteIpAddress () const |
| uint16 | GetRemotePort () const |
| template<SocketReadCallback Callback> | |
| void | AsyncRead (Callback &&callback) |
| void | QueuePacket (MessageBuffer &&buffer) |
| bool | IsOpen () const |
| void | CloseSocket () |
| void | DelayedCloseSocket () |
| Marks the socket for closing after write buffer becomes empty. | |
| MessageBuffer & | GetReadBuffer () |
| Stream & | underlying_stream () |
Protected Member Functions | |
| virtual void | OnClose () |
| virtual SocketReadCallbackResult | ReadHandler () |
| bool | AsyncProcessQueue () |
| void | SetNoDelay (bool enable) |
Private Member Functions | |
| bool | ReadHandlerInternal (boost::system::error_code const &error, size_t transferredBytes) |
| void | WriteHandlerWrapper (boost::system::error_code const &) |
| bool | HandleQueue () |
Private Attributes | |
| Stream | _socket |
| boost::asio::ip::address | _remoteAddress |
| uint16 | _remotePort = 0 |
| MessageBuffer | _readBuffer = MessageBuffer(READ_BLOCK_SIZE) |
| std::queue< MessageBuffer > | _writeQueue |
| std::atomic< uint8 > | _openState |
| bool | _isWritingAsync = false |
Static Private Attributes | |
| static constexpr uint8 | OpenState_Open = 0x0 |
| static constexpr uint8 | OpenState_Closing = 0x1 |
| Transition to Closed state after sending all queued data. | |
| static constexpr uint8 | OpenState_Closed = 0x2 |
Base async socket implementation
| Stream | stream type used for operations on socket Stream must implement the following methods: |
void close(boost::system::error_code& error);
void shutdown(boost::asio::socket_base::shutdown_type what, boost::system::error_code& shutdownError);
template<typename MutableBufferSequence, typename ReadHandlerType> void async_read_some(MutableBufferSequence const& buffers, ReadHandlerType&& handler);
template<typename ConstBufferSequence, typename WriteHandlerType> void async_write_some(ConstBufferSequence const& buffers, WriteHandlerType&& handler);
template<typename ConstBufferSequence> std::size_t write_some(ConstBufferSequence const& buffers, boost::system::error_code& error);
template<typename WaitHandlerType> void async_wait(boost::asio::socket_base::wait_type type, WaitHandlerType&& handler);
template<typename SettableSocketOption> void set_option(SettableSocketOption const& option, boost::system::error_code& error);
tcp::socket::endpoint_type remote_endpoint() const;
|
inlineexplicit |
|
inlineexplicit |
|
delete |
|
delete |
|
inlinevirtual |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inlineprotectedvirtual |
Reimplemented in WorldSocket.
Definition at line 223 of file Socket.h.
Here is the caller graph for this function:
|
delete |
|
delete |
|
inline |
|
inlineprotectedvirtual |
Reimplemented in AuthSession, and WorldSocket.
Definition at line 225 of file Socket.h.
Here is the caller graph for this function:
|
inlineprivate |
|
inlineprotected |
|
inlinevirtual |
Reimplemented in AuthSession, and WorldSocket.
|
inline |
|
inlinevirtual |
Reimplemented in AuthSession, and WorldSocket.
Definition at line 137 of file Socket.h.
Here is the call graph for this function:
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |