Date: Tue, 5 Dec 2000 15:45:33 -0800 From: "Ajay Jagannath" <ajaymj@hotmail.com> To: <freebsd-java@freebsd.org> Subject: Java Pgm Hangs Message-ID: <OE20ulIFRlgFTaxrd690000640b@hotmail.com>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
------=_NextPart_000_00F2_01C05ED2.673EB5C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi=20
import java.net.*;
public class TestSocket extends Thread
{
private ServerSocket s1 =3D null;
private ServerSocket s2 =3D null;
=20
public TestSocket() throws Exception
{
s1 =3D new ServerSocket(20000);
s1.setSoTimeout(500);
=20
s2 =3D new ServerSocket(21000);
s2.setSoTimeout(500);
}=20
=20
public static void main(String args[]) throws Exception
{
TestSocket ts =3D new TestSocket();
ts.start();
}
=20
public void run()
{
for(;;)
{
Socket in;
try
{
System.out.println("s1 timeout "+s1.getSoTimeout());
in =3D s1.accept();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
try
{
System.out.println("s2 timeout "+s2.getSoTimeout());
in =3D s2.accept();
}
catch(Exception e1)
{
System.out.println(e1.getMessage());
}
}
}
}
When I set the system date back by 3 or minutes using the date command =
than the above java program hanges.
Is there a workaround or a bug fix for this=20
Version: FreeBSD 3.4
Jdk 1.1.7
Thanks
Ajay Jagannath
------=_NextPart_000_00F2_01C05ED2.673EB5C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4207.2601" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c0c0c0>
<DIV><FONT face=3DArial size=3D2>Hi </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>import java.net.*;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>public class TestSocket extends=20
Thread<BR>{<BR> private ServerSocket s1 =3D null;<BR> private=20
ServerSocket s2 =3D null;<BR> <BR> public TestSocket() throws=20
Exception<BR> {<BR> s1 =3D new=20
ServerSocket(20000);<BR> s1.setSoTimeout(500);<BR> =
<BR> s2=20
=3D new=20
ServerSocket(21000);<BR> s2.setSoTimeout(500);<BR> } =
;<BR> <BR> public=20
static void main(String args[]) throws=20
Exception<BR> {<BR> TestSocket ts =3D new=20
TestSocket();<BR> ts.start();<BR> }<BR> <BR> pu=
blic=20
void=20
run()<BR> {<BR> for(;;)<BR> {<BR> &=
nbsp;Socket=20
in;<BR> try<BR> {<BR> =
System.out.println("s1=20
timeout "+s1.getSoTimeout());<BR> in =3D=20
s1.accept();<BR> }<BR> catch(Exception =
e)<BR> {<BR> System.out.println(e=
.getMessage());<BR> }<BR> try<BR> =
{<BR> System.out.println("s2=20
timeout "+s2.getSoTimeout());<BR> in =3D=20
s2.accept();<BR> }<BR> catch(Exception =
e1)<BR> {<BR> System.out.println(=
e1.getMessage());<BR> }<BR> }<BR> }<BR>}=
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>When I set the system date back by =
3 or=20
minutes using the date command than the above java program =
hanges.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Is there a workaround or a bug fix for =
this=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Version: FreeBSD 3.4</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Jdk 1.1.7</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Ajay Jagannath</DIV>
<DIV><BR></DIV></FONT></BODY></HTML>
------=_NextPart_000_00F2_01C05ED2.673EB5C0--
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?OE20ulIFRlgFTaxrd690000640b>
