Java Reference
In-Depth Information
public
class
DefaultSocketOptionValues
{
public
static
void
main
(
String
[]
args
)
{
try
(
DatagramChannel
channel
=
DatagramChannel
.
open
())
{
for
(
SocketOption
<?>
option
:
channel
.
supportedOptions
())
{
System
.
out
.
println
(
option
.
name
()
+
": "
+
channel
.
getOption
(
option
));
}
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
}
}
}
Here's the output I got on my Mac:
IP_MULTICAST_TTL: 1
SO_BROADCAST: false
SO_REUSEADDR: false
SO_RCVBUF: 196724
IP_MULTICAST_LOOP: true
SO_SNDBUF: 9216
IP_MULTICAST_IF: null
IP_TOS: 0
It's a bit surprising that my send buffer is so much larger than my receive buffer.