MCPcopy Create free account
hub / github.com/SIPp/sipp / rtpstream_setsocketoptions

Function rtpstream_setsocketoptions

src/rtpstream.cpp:1804–1824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1802}
1803
1804static int rtpstream_setsocketoptions(int sock)
1805{
1806 /* set socket non-blocking */
1807 int flags = fcntl(sock, F_GETFL, 0);
1808 if (fcntl(sock, F_SETFL, flags | O_NONBLOCK) == -1) {
1809 return 0;
1810 }
1811
1812 /* set buffer size */
1813 unsigned int buffsize = rtp_buffsize;
1814
1815 /* Increase buffer sizes for this sockets */
1816 if(setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char*)&buffsize, sizeof(buffsize))) {
1817 return 0;
1818 }
1819 if(setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&buffsize, sizeof(buffsize))) {
1820 return 0;
1821 }
1822
1823 return 1; /* success */
1824}
1825
1826/* code checked */
1827static int rtpstream_get_localport(int* rtpsocket, int* rtcpsocket)

Callers 1

rtpstream_get_localportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected