MCPcopy Create free account
hub / github.com/HumbleNet/HumbleNet / resetSocketOptions

Function resetSocketOptions

3rdparty/Amalgamate/juce_core_amalgam.cpp:7043–7054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7041 }
7042
7043 static bool resetSocketOptions (const int handle, const bool isDatagram, const bool allowBroadcast) noexcept
7044 {
7045 const int sndBufSize = 65536;
7046 const int rcvBufSize = 65536;
7047 const int one = 1;
7048
7049 return handle > 0
7050 && setsockopt (handle, SOL_SOCKET, SO_RCVBUF, (const char*) &rcvBufSize, sizeof (rcvBufSize)) == 0
7051 && setsockopt (handle, SOL_SOCKET, SO_SNDBUF, (const char*) &sndBufSize, sizeof (sndBufSize)) == 0
7052 && (isDatagram ? ((! allowBroadcast) || setsockopt (handle, SOL_SOCKET, SO_BROADCAST, (const char*) &one, sizeof (one)) == 0)
7053 : (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (one)) == 0));
7054 }
7055
7056 static bool bindSocketToPort (const int handle, const int port) noexcept
7057 {

Callers 4

connectSocketFunction · 0.85
StreamingSocketMethod · 0.85
connectMethod · 0.85
DatagramSocketMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected