From owner-java@FreeBSD.ORG Tue Dec 9 12:25:52 1997 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA01459 for java-outgoing; Tue, 9 Dec 1997 12:25:52 -0800 (PST) (envelope-from owner-java@FreeBSD.ORG) Received: from zed.ludd.luth.se (zed.ludd.luth.se [130.240.16.33]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id MAA01412 for ; Tue, 9 Dec 1997 12:25:26 -0800 (PST) (envelope-from pantzer@brother.ludd.luth.se) Received: from brother.ludd.luth.se (pantzer@brother.ludd.luth.se [130.240.16.78]) by zed.ludd.luth.se (8.8.5/8.8.5) with SMTP id VAA26499; Tue, 9 Dec 1997 21:25:17 +0100 Message-Id: <199712092025.VAA26499@zed.ludd.luth.se> X-Mailer: exmh version 2.0zeta 7/24/97 To: "Alex.Boisvert" cc: freebsd-java@FreeBSD.ORG Subject: Re: Beta JDK 1.1.2 port for FreeBSD In-reply-to: Your message of "Mon, 08 Dec 1997 11:33:22 EST." Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_-14600911360" Date: Tue, 09 Dec 1997 21:25:16 +0100 From: Mattias Pantzare Sender: owner-java@FreeBSD.ORG Precedence: bulk This is a multipart MIME message. --==_Exmh_-14600911360 Content-Type: text/plain; charset=us-ascii > I just uploaded a new port of Sun's JDK 1.1.2 for FreeBSD at: > > "ftp://ftp.freebsd.org/pub/FreeBSD/incoming" > > Right now, there are two files, but only one is the right one: > > "jdk1.1.2-fbsd1.tgz.good" > > This is a "beta" release for people on this list, it'll probably release > another one in 2 weeks, after I get some initial comments on it. It has multicast problems. I get this when I run the attached test program: pantzer@skalman ~/java/mcast >java MulticastServer 224.111.11.1 1234 Multicast Server listening on port:1234 java.net.SocketException: Inappropriate ioctl for device The jdk1.1-kwhite port had the same problem, and the followig patch to src/freebsd/net/multicast.c fixed that in that port: 70c70 < if (!IN_MULTICAST(mname.imr_multiaddr.s_addr)) { --- > if (!IN_MULTICAST(addrptr->address)) { 114c114 < if (!IN_MULTICAST(mname.imr_multiaddr.s_addr)) { --- > if (!IN_MULTICAST(addrptr->address)) { It was just a simple mater of changing byte order at the wrong place. --==_Exmh_-14600911360 Content-Type: text/plain ; name="MulticastServer.java"; charset=us-ascii Content-Description: MulticastServer.java Content-Disposition: attachment; filename="MulticastServer.java" import java.io.*; import java.net.*; import java.util.*; // Run this classes as: // java_g MulticastServer 224.111.11.1 1234 // java_g MulticastClient 224.111.11.1 1234 // class MulticastServer { public static void main(String argv[]) { if (argv.length!=2) { System.out.println("java MulticastServer "); return; } try { int port = Integer.parseInt(argv[1]); MulticastSocket s = new MulticastSocket(port); // MulticastSocket s = new MulticastSocket(); System.out.print("Multicast Server listening on port:"); System.out.println(s.getLocalPort()); // join the multicast group s.joinGroup(InetAddress.getByName(argv[0])); byte buf[] = new byte[15]; DatagramPacket dp = new DatagramPacket(buf, buf.length); s.receive(dp); System.out.print("Received from inet address: " + dp.getAddress().toString()); System.out.println(" port number: " + dp.getPort()); System.out.println("Packet of length: " + dp.getLength()); for (int i=0; i "); return; } try { int port = Integer.parseInt(argv[1]); InetAddress in = InetAddress.getByName(argv[0]); MulticastSocket s = new MulticastSocket(); byte buf[] = new byte[10]; for (int i=0; i