One sender thread per client. Requires loads of resources. Kind of hacked, because the internal dependencies are very ugly now. Requires loads of testing. A problem might be the last packet sent by the server to a specific client before closing the connection, for example an error message. It might never even reach the client, because the sender thread is terminated before. I have not yet found a good way to fix this.

This commit is contained in:
lotodore
2009-01-07 21:52:16 +00:00
parent 606158c4f0
commit d72cdb6873
16 changed files with 150 additions and 325 deletions
+3 -3
View File
@@ -627,7 +627,7 @@ ClientStateStartSession::Process(ClientThread &client)
boost::shared_ptr<NetPacket> packet(new NetPacketInit);
((NetPacketInit *)packet.get())->SetData(initData);
client.GetSender().Send(context.GetSessionData(), packet);
context.GetSessionData()->GetSender().Send(context.GetSessionData(), packet);
client.SetState(ClientStateWaitSession::Instance());
@@ -903,7 +903,7 @@ ClientStateWaitSession::InternalProcess(ClientThread &client, boost::shared_ptr<
tmpList);
if (!avatarError)
client.GetSender().Send(client.GetContext().GetSessionData(), tmpList);
client.GetContext().GetSessionData()->GetSender().Send(client.GetContext().GetSessionData(), tmpList);
else
throw ClientException(__FILE__, __LINE__, avatarError, 0);
}
@@ -1055,7 +1055,7 @@ ClientStateSynchronizeStart::Process(ClientThread &client)
{
// Acknowledge start.
boost::shared_ptr<NetPacket> startAck(new NetPacketStartEventAck);
client.GetSender().Send(client.GetContext().GetSessionData(), startAck);
client.GetContext().GetSessionData()->GetSender().Send(client.GetContext().GetSessionData(), startAck);
// Unsubscribe lobby messages.
client.UnsubscribeLobbyMsg();