We can now send more data with UDP than previously, the splitting seems to work fine but receiving has some problems.

This commit is contained in:
Jocke
2016-03-09 18:26:33 +01:00
parent 3828616b60
commit 3209e36176
9 changed files with 161 additions and 54 deletions
+8 -6
View File
@@ -50,13 +50,15 @@ void Client::Update()
{
m_EventBroker->Process<Client>();
while (m_Unreliable.IsSocketAvailable()) {
// Packet will get real data in receive
Packet packet(MessageType::Invalid);
m_Unreliable.Receive(packet);
if (packet.GetMessageType() == MessageType::Connect) {
parseUDPConnect(packet);
m_Unreliable.ReceivePackets();
}
// Packet will get real data in GetNextPacket()
Packet parsedPacket(MessageType::Invalid);
while (m_Unreliable.GetNextPacket(parsedPacket)) {
if (parsedPacket.GetMessageType() == MessageType::Connect) {
parseUDPConnect(parsedPacket);
} else {
parseMessageType(packet);
parseMessageType(parsedPacket);
}
}