Mac OS X issues
TOS issue
When running with JDK 5 (same for 6 beta), the following exception occurs if tos (in UDP) is set to a value greater than 0:
traffic class of 8 could not be set, will be ignored java.net.SocketException: Invalid argument at java.net.PlainDatagramSocketImpl.socketSetOption(Native Method) at java.net.PlainDatagramSocketImpl.setOption(PlainDatagramSocketImpl.java:299) at java.net.DatagramSocket.setTrafficClass(DatagramSocket.java:1052) at org.jgroups.protocols.UDP.createSockets(UDP.java:460) at org.jgroups.protocols.UDP.start(UDP.java:362) at org.jgroups.stack.Configurator.startProtocolStack(Configurator.java:75) at org.jgroups.stack.ProtocolStack.startStack(ProtocolStack.java:273) at org.jgroups.JChannel.connect(JChannel.java:368) at SimpleChat.start(SimpleChat.java:20) at SimpleChat.main(SimpleChat.java:85)
The reason is that this call is not implemented properly in the IPv6 stack of the JDK 5 port for Mac OS X: http://lists.apple.com/archives/java-dev/2006/Jun/msg00414.html.
This can be avoided by using the IPv4 stack: -Djava.net.preferIPv4Stack=true.
The JGroups JIRA issue is http://jira.jboss.com/jira/browse/JGRP-561. This hasn't been fixed in JDK 6 beta (as of July 2007).
UDP Messages sent over the loopback (localhost) with a size > mtu (default is 16K) are silently discarded
There is a bug in the loopback adapter in Mac OSX 10.4.X (Tiger). This default limit is significantly smaller than the 65K on Windows, see http://lists.apple.com/archives/java-dev/2005/Jul/msg00423.html.
This is really bad, especially since there isn't even a warning!
Therefore, either the mtu on the loopback has to be increased:
sudo ifconfig lo0 mtu 65535
Or, the following parameters have to be below the 16K:
UDP.max_bundle_size
NAKACK.max_xmit_size and
FRAG2.frag_size
The JIRA issue is http://jira.jboss.com/jira/browse/JGRP-560
Comments