4 Commits

Author SHA1 Message Date
EricksOliveira
eabad44d4b Revert "Update PlayerbotCommandServer.cpp"
This reverts commit 8f2455b7663c935fb33d3552bb1371390d1106f8.
2024-10-18 14:40:25 -03:00
EricksOliveira
8f2455b766 Update PlayerbotCommandServer.cpp
Protection against race conditions: Added a global mutex (session_mutex) to synchronize access to the session() function when multiple threads are running. This avoids concurrency problems in environments with many simultaneous connections.

Thread pool usage: Replaced manual thread creation with boost::thread with a thread pool using boost::asio::thread_pool. The thread pool improves resource management and limits the number of simultaneous threads, optimizing performance.

Checking for socket errors: Added check to ensure the socket is not null or closed before trying to read it.
Implemented detailed error handling for readings and writings, including detailed logs to facilitate debugging.
Secure socket closure: Now sockets are correctly closed at the end of the session, even in the event of an error, preventing resource leaks.
2024-10-18 14:37:54 -03:00
Yunfan Li
53611c9040 Run clang-format 2024-08-04 10:23:36 +08:00
UltraNix
b952636f0d Big update. 2022-03-12 22:27:09 +01:00