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>
index | next in thread | raw e-mail
[-- Attachment #1 --]
Hi
import java.net.*;
public class TestSocket extends Thread
{
private ServerSocket s1 = null;
private ServerSocket s2 = null;
public TestSocket() throws Exception
{
s1 = new ServerSocket(20000);
s1.setSoTimeout(500);
s2 = new ServerSocket(21000);
s2.setSoTimeout(500);
}
public static void main(String args[]) throws Exception
{
TestSocket ts = new TestSocket();
ts.start();
}
public void run()
{
for(;;)
{
Socket in;
try
{
System.out.println("s1 timeout "+s1.getSoTimeout());
in = s1.accept();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
try
{
System.out.println("s2 timeout "+s2.getSoTimeout());
in = 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
Version: FreeBSD 3.4
Jdk 1.1.7
Thanks
Ajay Jagannath
[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4207.2601" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#c0c0c0>
<DIV><FONT face=Arial size=2>Hi </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>import java.net.*;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>public class TestSocket extends
Thread<BR>{<BR> private ServerSocket s1 = null;<BR> private
ServerSocket s2 = null;<BR> <BR> public TestSocket() throws
Exception<BR> {<BR> s1 = new
ServerSocket(20000);<BR> s1.setSoTimeout(500);<BR> <BR> s2
= new
ServerSocket(21000);<BR> s2.setSoTimeout(500);<BR> } <BR> <BR> public
static void main(String args[]) throws
Exception<BR> {<BR> TestSocket ts = new
TestSocket();<BR> ts.start();<BR> }<BR> <BR> public
void
run()<BR> {<BR> for(;;)<BR> {<BR> Socket
in;<BR> try<BR> {<BR> System.out.println("s1
timeout "+s1.getSoTimeout());<BR> in =
s1.accept();<BR> }<BR> catch(Exception
e)<BR> {<BR> System.out.println(e.getMessage());<BR> }<BR> try<BR> {<BR> System.out.println("s2
timeout "+s2.getSoTimeout());<BR> in =
s2.accept();<BR> }<BR> catch(Exception
e1)<BR> {<BR> System.out.println(e1.getMessage());<BR> }<BR> }<BR> }<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>When I set the system date back by 3 or
minutes using the date command than the above java program hanges.</FONT></DIV>
<DIV><FONT face=Arial size=2>Is there a workaround or a bug fix for this
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Version: FreeBSD 3.4</FONT></DIV>
<DIV><FONT face=Arial size=2>Jdk 1.1.7</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Ajay Jagannath</DIV>
<DIV><BR></DIV></FONT></BODY></HTML>
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?OE20ulIFRlgFTaxrd690000640b>
