Subject: linux emul problem with sun-jre13?
To: None <tech-userlevel@netbsd.org>
From: Julio M. Merino Vidal <jmmv@menta.net>
List: tech-userlevel
Date: 06/08/2004 17:23:36
Hi all,

I have written a small chat server using Java.  It works just fine with
sun-jre14 (linux emulation) and kaffe (native).  But it does strange
things with sun-jre13.

In concrete, the readUTF function from DataInputStream throws an
IOException as soon as there is no more data in the connection buffer.
Instead, it should just block and wait for more data.  I tried this
under Linux with the same version of the jre, 1.3.1, and it worked
correctly.

FWIW, the following ugly workaround makes it work:

String s = null;
while (s == null) {
	try {
		s = dis.readUTF();
	} catch(IOException e) {}
}

Can this be a linux emulation problem?

Thanks.

-- 
Julio M. Merino Vidal <jmmv@menta.net>
The NetBSD Project - http://www.NetBSD.org/