Skip to Main Content

Embedded Technologies

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Receiving multicast datagram in IBM J9 on PPC2003

843849Oct 3 2005 — edited Oct 3 2005
Hi there,

I want to receive multicast datagrams in a Java aplication executed in IBM J9 (version is from mid-2004) on a PPC2003, but I receive a "java.lang.SocketException: Bad socket".

I can send multicast datagrams from the PDA, but cannot receive them. I execute the same code (same binaries) on my notebook and everything is fine. The connection is an Ad-Hoc 802.11b WLAN.

Here is the code that I am about to execute:
try {
	final MulticastSocket ms = new MulticastSocket(12345);
	ms.joinGroup(InetAddress.getByName("224.5.6.7"));
	final String msg = "Hallo Welt vom iPaq";
	DatagramPacket dp = new DatagramPacket(msg.getBytes(), msg.length(), InetAddress.getByName("224.5.6.7"), 12345);
	(new Thread(new Runnable() {
		public void run() {
			try {
				byte[] buffer = new byte[msg.length()];
				DatagramPacket newDP = new DatagramPacket(buffer, buffer.length);
				ms.receive(newDP);
				System.out.println(new String(buffer));
			} catch (Throwable Ex) {
				Ex.printStackTrace();
			}
		}
	})).start();
	ms.send(dp);
	ms.close();
} catch (Throwable T) { T.printStackTrace(); }
I would appreciate any help.
Bjoern
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2005
Added on Oct 3 2005
1 comment
92 views