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
16 changed files with 242 additions and 75 deletions

View File

@@ -41,7 +41,7 @@ public:
/// Stops all network threads, It will wait for all running threads .
void StopNetwork() override;
void OnSocketOpen(tcp::socket&& sock, uint32 threadIndex) override;
void OnSocketOpen(IoContextTcpSocket&& sock, uint32 threadIndex) override;
std::size_t GetApplicationSendBufferSize() const { return _socketApplicationSendBufferSize; }
@@ -50,9 +50,9 @@ protected:
NetworkThread<WorldSocket>* CreateThreads() const override;
static void OnSocketAccept(tcp::socket&& sock, uint32 threadIndex)
static void OnSocketAccept(IoContextTcpSocket&& sock, uint32 threadIndex)
{
Instance().OnSocketOpen(std::forward<tcp::socket>(sock), threadIndex);
Instance().OnSocketOpen(std::move(sock), threadIndex);
}
private: