Core/Networking: Rewrite networking threading model

Each network thread has its own io_service - this means that all operations on a given socket except queueing packets run from a single thread, removing the need for locking
Sending packets now writes to a lockfree intermediate queue directly, encryption is applied in network thread if it was required at the time of sending the packet

(cherry picked from commit 97a79af470)
This commit is contained in:
Shauren
2016-02-20 13:08:03 +01:00
parent d4184065b6
commit b2e03a7448
12 changed files with 282 additions and 184 deletions

View File

@@ -274,10 +274,7 @@ void AuthSession::SendPacket(ByteBuffer& packet)
{
MessageBuffer buffer;
buffer.Write(packet.contents(), packet.size());
std::unique_lock<std::mutex> guard(_writeLock);
QueuePacket(std::move(buffer), guard);
QueuePacket(std::move(buffer));
}
}