Ver código fonte

Fix bug causing UDP socket to close after the first send if not listening

The ring buffer for receiving packets was not resized in constructor

(cherry picked from commit 68dc969f8ca242d0c4f927a417557288e4b1b75f)
Fabio Alessandrelli 8 anos atrás
pai
commit
7dbccc9a57

+ 1 - 0
drivers/unix/packet_peer_udp_posix.cpp

@@ -269,6 +269,7 @@ PacketPeerUDPPosix::PacketPeerUDPPosix() {
 	queue_count = 0;
 	peer_port = 0;
 	sock_type = IP::TYPE_NONE;
+	rb.resize(8);
 }
 
 PacketPeerUDPPosix::~PacketPeerUDPPosix() {

+ 1 - 0
platform/windows/packet_peer_udp_winsock.cpp

@@ -278,6 +278,7 @@ PacketPeerUDPWinsock::PacketPeerUDPWinsock() {
 	queue_count = 0;
 	peer_port = 0;
 	sock_type = IP::TYPE_NONE;
+	rb.resize(8);
 }
 
 PacketPeerUDPWinsock::~PacketPeerUDPWinsock() {