Skip site navigation (1)Skip section navigation (2)
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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>import java.net.*;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>public class TestSocket extends 
Thread<BR>{<BR>&nbsp;private ServerSocket s1 = null;<BR>&nbsp;private 
ServerSocket s2 = null;<BR>&nbsp;<BR>&nbsp;public TestSocket() throws 
Exception<BR>&nbsp;{<BR>&nbsp;&nbsp;s1 = new 
ServerSocket(20000);<BR>&nbsp;&nbsp;s1.setSoTimeout(500);<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;s2 
= new 
ServerSocket(21000);<BR>&nbsp;&nbsp;s2.setSoTimeout(500);<BR>&nbsp;}&nbsp;<BR>&nbsp;&nbsp;<BR>&nbsp;public 
static void main(String args[]) throws 
Exception<BR>&nbsp;{<BR>&nbsp;&nbsp;TestSocket ts = new 
TestSocket();<BR>&nbsp;&nbsp;ts.start();<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;public 
void 
run()<BR>&nbsp;{<BR>&nbsp;&nbsp;for(;;)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;Socket 
in;<BR>&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("s1 
timeout "+s1.getSoTimeout());<BR>&nbsp;&nbsp;&nbsp;&nbsp;in = 
s1.accept();<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;catch(Exception 
e)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(e.getMessage());<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("s2 
timeout "+s2.getSoTimeout());<BR>&nbsp;&nbsp;&nbsp;&nbsp;in = 
s2.accept();<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;catch(Exception 
e1)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(e1.getMessage());<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>When I&nbsp;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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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>