![]() |
TrinityCore
|
#include <Socket.h>
Inheritance diagram for Trinity::Net::Socket< Stream >:Classes | |
| struct | Endpoint |
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 () |
| template<BOOST_ASIO_COMPLETION_TOKEN_FOR(void(boost::system::error_code, boost::asio::ip::tcp::endpoint)) Callback> | |
| decltype(auto) | Connect (boost::asio::ip::tcp::endpoint const &endpoint, Callback &&callback) |
| template<BOOST_ASIO_COMPLETION_TOKEN_FOR(void(boost::system::error_code, boost::asio::ip::tcp::endpoint)) Callback> | |
| decltype(auto) | Connect (std::vector< boost::asio::ip::tcp::endpoint > const &endpoints, Callback &&callback) |
| virtual bool | Update () |
| boost::asio::ip::address const & | GetRemoteIpAddress () const |
| uint16 | GetRemotePort () const |
| void | SetRemoteEndpoint (boost::asio::ip::tcp::endpoint const &endpoint) |
| template<invocable_r< SocketReadCallbackResult > 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 | QueuedBufferWriteDone () |
| void | WriteHandlerWrapper (boost::system::error_code const &) |
| bool | HandleQueue () |
Private Attributes | |
| Stream | _socket |
| struct Trinity::Net::Socket::Endpoint | _remoteEndpoint |
| MessageBuffer | _readBuffer = MessageBuffer(0x1000) |
| 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: |
boost::asio::io_context::executor_type get_executor();
bool is_open() const;
void close(boost::system::error_code& error);
void shutdown(boost::asio::socket_base::shutdown_type what, boost::system::error_code& shutdownError);
template<typename ConnectHandlerType> void async_connect(boost::asio::ip::tcp::endpoint const& endpoint, ConnectHandlerType&& handler);
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 |
Reimplemented in Trinity::Net::Http::Socket.
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inlineprotectedvirtual |
Reimplemented in WorldSocket.
Definition at line 260 of file Socket.h.
Here is the caller graph for this function:
|
delete |
|
delete |
|
inlineprivate |
|
inline |
|
inlineprotectedvirtual |
Reimplemented in Trinity::Net::Http::BaseSocket< Stream >, Trinity::Net::Http::BaseSocket< Impl::BoostBeastSocketWrapper >, Trinity::Net::Http::BaseSocket< SslStream< Impl::BoostBeastSocketWrapper > >, and WorldSocket.
Definition at line 262 of file Socket.h.
Here is the caller graph for this function:
|
inlineprivate |
|
inlineprotected |
|
inline |
|
inlinevirtual |
|
inline |
|
inlinevirtual |
Reimplemented in Trinity::Net::Http::BaseSocket< Stream >, Trinity::Net::Http::BaseSocket< Impl::BoostBeastSocketWrapper >, Trinity::Net::Http::BaseSocket< SslStream< Impl::BoostBeastSocketWrapper > >, and WorldSocket.
Definition at line 170 of file Socket.h.
Here is the call graph for this function:
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |