From 7dbccc9a57c7579be7f3edcf99b35cf4804b4723 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Wed, 18 Jan 2017 21:33:55 +0100 Subject: [PATCH] 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) --- drivers/unix/packet_peer_udp_posix.cpp | 1 + platform/windows/packet_peer_udp_winsock.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 4040aaaf4b1..4e48e835099 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/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() { diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp index e326a5a6fb5..5290eebc4a7 100644 --- a/platform/windows/packet_peer_udp_winsock.cpp +++ b/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() {