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 9336857132)
This commit is contained in:
Fabio Alessandrelli 2017-01-19 13:33:10 +01:00
parent 7dbccc9a57
commit 994df5df5c
2 changed files with 4 additions and 4 deletions

View file

@ -158,7 +158,7 @@ void PacketPeerUDPPosix::close() {
::close(sockfd); ::close(sockfd);
sockfd = -1; sockfd = -1;
sock_type = IP::TYPE_NONE; sock_type = IP::TYPE_NONE;
rb.resize(8); rb.resize(16);
queue_count = 0; queue_count = 0;
} }
@ -269,7 +269,7 @@ PacketPeerUDPPosix::PacketPeerUDPPosix() {
queue_count = 0; queue_count = 0;
peer_port = 0; peer_port = 0;
sock_type = IP::TYPE_NONE; sock_type = IP::TYPE_NONE;
rb.resize(8); rb.resize(16);
} }
PacketPeerUDPPosix::~PacketPeerUDPPosix() { PacketPeerUDPPosix::~PacketPeerUDPPosix() {

View file

@ -152,7 +152,7 @@ void PacketPeerUDPWinsock::close() {
::closesocket(sockfd); ::closesocket(sockfd);
sockfd = -1; sockfd = -1;
sock_type = IP::TYPE_NONE; sock_type = IP::TYPE_NONE;
rb.resize(8); rb.resize(16);
queue_count = 0; queue_count = 0;
} }
@ -278,7 +278,7 @@ PacketPeerUDPWinsock::PacketPeerUDPWinsock() {
queue_count = 0; queue_count = 0;
peer_port = 0; peer_port = 0;
sock_type = IP::TYPE_NONE; sock_type = IP::TYPE_NONE;
rb.resize(8); rb.resize(16);
} }
PacketPeerUDPWinsock::~PacketPeerUDPWinsock() { PacketPeerUDPWinsock::~PacketPeerUDPWinsock() {