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:
blinkysc 2026-01-15 07:47:58 -06:00 committed by GitHub
parent a8ce95ad71
commit d908b4c2fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 242 additions and 75 deletions

View file

@ -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;