From 994df5df5c1a0062582d39f944ac1857a4881c00 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 19 Jan 2017 13:33:10 +0100 Subject: [PATCH] Use default UDP ring buffer size of 65536 for clients We should probably create a specific function for setting the recv buffer anyway. UDP sockets does not need to bind (listen) to be able to call recvfrom. This is especially useful for clients who just call set_send_address and start communicating with a server. (cherry picked from commit 93368571326e3472522669b76998f58aed78864f) --- drivers/unix/packet_peer_udp_posix.cpp | 4 ++-- platform/windows/packet_peer_udp_winsock.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 4e48e835099..f7ca6f83404 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -158,7 +158,7 @@ void PacketPeerUDPPosix::close() { ::close(sockfd); sockfd = -1; sock_type = IP::TYPE_NONE; - rb.resize(8); + rb.resize(16); queue_count = 0; } @@ -269,7 +269,7 @@ PacketPeerUDPPosix::PacketPeerUDPPosix() { queue_count = 0; peer_port = 0; sock_type = IP::TYPE_NONE; - rb.resize(8); + rb.resize(16); } PacketPeerUDPPosix::~PacketPeerUDPPosix() { diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp index 5290eebc4a7..00c317183a5 100644 --- a/platform/windows/packet_peer_udp_winsock.cpp +++ b/platform/windows/packet_peer_udp_winsock.cpp @@ -152,7 +152,7 @@ void PacketPeerUDPWinsock::close() { ::closesocket(sockfd); sockfd = -1; sock_type = IP::TYPE_NONE; - rb.resize(8); + rb.resize(16); queue_count = 0; } @@ -278,7 +278,7 @@ PacketPeerUDPWinsock::PacketPeerUDPWinsock() { queue_count = 0; peer_port = 0; sock_type = IP::TYPE_NONE; - rb.resize(8); + rb.resize(16); } PacketPeerUDPWinsock::~PacketPeerUDPWinsock() {