refactor(Core/Network): Port TrinityCore socket optimizations (#24384)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: Shauren <shauren@users.noreply.github.com>
This commit is contained in:
parent
a8ce95ad71
commit
d908b4c2fc
16 changed files with 242 additions and 75 deletions
|
|
@ -91,13 +91,13 @@ public:
|
|||
SocketAdded(sock);
|
||||
}
|
||||
|
||||
tcp::socket* GetSocketForAccept() { return &_acceptSocket; }
|
||||
IoContextTcpSocket* GetSocketForAccept() { return &_acceptSocket; }
|
||||
|
||||
void EnableProxyProtocol() { _proxyHeaderReadingEnabled = true; }
|
||||
|
||||
protected:
|
||||
virtual void SocketAdded(std::shared_ptr<SocketType> /*sock*/) { }
|
||||
virtual void SocketRemoved(std::shared_ptr<SocketType> /*sock*/) { }
|
||||
virtual void SocketAdded(std::shared_ptr<SocketType> const& /*sock*/) { }
|
||||
virtual void SocketRemoved(std::shared_ptr<SocketType> const& /*sock*/) { }
|
||||
|
||||
void AddNewSockets()
|
||||
{
|
||||
|
|
@ -229,7 +229,7 @@ private:
|
|||
SocketContainer _newSockets;
|
||||
|
||||
Acore::Asio::IoContext _ioContext;
|
||||
tcp::socket _acceptSocket;
|
||||
IoContextTcpSocket _acceptSocket;
|
||||
boost::asio::steady_timer _updateTimer;
|
||||
|
||||
bool _proxyHeaderReadingEnabled;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue