Hi,Laurinolli,
Thank you for your suggestion,and I have create a test case as following:

public class ConnectFutureTest {
 public static void main(String[] args) {
  SocketConnector connector = new NioSocketConnector();
  connector.setHandler(new IoHandlerAdapter());
  for(int i=0;i<5;i++){
   ConnectFuture connectFuture = connector.connect(new InetSocketAddress(" 
192.168.18.9", 4567));
   try {
    long time=System.currentTimeMillis();
    connectFuture.await(5000);//5000 millisesonds
    System.out.println(System.currentTimeMillis()-time);
   } catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
  }
 }
}

The print result is different in different PC, 
In  notebook PC(ThinkPad T61,T8300, 2 CPU) the result is :

0
0
0
0
0
It seems the code can't work : " connectFuture.await(5000);"

In  desktop PC(2 CPU) the result is :
5015
5000
5005
5000
5010
the result seems right.
I don't know why ?

BR
Allen



----- Original Message ----- 
From: "Tuure Laurinolli" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, September 15, 2008 4:09 PM
Subject: Re: Fw: API Issue: ConnectFuture.await()


> Allen Jiang wrote:
>> Hi,
>>      The JVM is jre1.5.0_11,the system is Microsoft Windows XP Professional 
>> 2002 SP2, The IDE is Eclipse 3.4 ,and attach my part code,you only pay more 
>> attention on the highlight line ,thank you.
> 
> Please create a test case that has no other external dependencies
> besides MINA. It's easier to test that way. The test case should also be
> a complete program that compiles, not just a method snipped from some
> larger program.

Reply via email to