BUG: Receive() is failing
This commit is contained in:
@@ -211,8 +211,11 @@ int UDPNetworkUtility::SendToAllChannels(SerialPacket* serialPacket) {
|
|||||||
int UDPNetworkUtility::Receive(SerialPacket* serialPacket) {
|
int UDPNetworkUtility::Receive(SerialPacket* serialPacket) {
|
||||||
memset(packet->data, 0, packet->maxlen);
|
memset(packet->data, 0, packet->maxlen);
|
||||||
int ret = SDLNet_UDP_Recv(socket, packet);
|
int ret = SDLNet_UDP_Recv(socket, packet);
|
||||||
|
if (ret > 0) {
|
||||||
|
//BUG: This simply fails
|
||||||
serialPacket->Deserialize(packet->data);
|
serialPacket->Deserialize(packet->data);
|
||||||
serialPacket->srcAddress = packet->address;
|
serialPacket->srcAddress = packet->address;
|
||||||
|
}
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
throw(std::runtime_error("Unknown network error occured"));
|
throw(std::runtime_error("Unknown network error occured"));
|
||||||
|
|||||||
Reference in New Issue
Block a user