In an existing networking library I've been tasked to work on there is a call to setsockopt
which I don't understand
Here you can see a TCP socket begin created:
[socket] fd(11) domain(2:AF_INET) type(1:SOCK_STREAM) protocol(0:default)
Immediately afterward, a call to setsockopt
is made for option SO_BROADCAST
at the IPPROTO_TCP
protocol level, with option value 5
[setsockopt] fd(11) level(6:IPPROTO_TCP) option(6:SO_BROADCAST) ret(0) option:
0 0500 0000 ....
According to Beej's guide to networking this "Does nothing—NOTHING!!—to TCP stream sockets! Hahaha!"
Questions:
- What exactly are they doing here?
- Does this make any sense?
- If anything, surely it should be
option_value=1
, so what is the5
about?