dev@grizzly.java.net

Re: Strange behavior of Grizzly

From: Minoru Nitta <minoru.nitta_at_jp.fujitsu.com>
Date: Fri, 12 Jun 2009 11:32:37 +0900

Hi Bongjae,


I tested your program. I modified only DatagramSocketClient part as I mentioned
before. I tested your program on RHEL4, becuase I doubt Windows platform.
The result was always like

Wait for 2000(ms)
current thread: Thread[server-WorkerThread(0),5,Grizzly], Request: hello world-1
current thread: Thread[server-WorkerThread(5),5,Grizzly], Request: hello world-2
current thread: Thread[server-WorkerThread(6),5,Grizzly], Request: hello world-3
current thread: Thread[server-WorkerThread(7),5,Grizzly], Request: hello world-4
current thread: Thread[server-WorkerThread(8),5,Grizzly], Request: hello world-5
current thread: Thread[server-WorkerThread(9),5,Grizzly], Request: hello world-6
current thread: Thread[server-WorkerThread(10),5,Grizzly], Request: hello world-7
###Binding duplicated socket again..###
current thread: Thread[client-WorkerThread(6),5,Grizzly], Request: hello world-8
current thread: Thread[client-WorkerThread(7),5,Grizzly], Request: hello world-9
current thread: Thread[client-WorkerThread(8),5,Grizzly], Request: hello world-10
          :

and this was exactly same as what I expected. During the test, I monitored
by netstat command. Here is the snippet.

Proto Recv-Q Send-Q Local Address Foreign Address State
udp 0 0 rx200-3:9090 rx200-3:9090 ESTABLISHED
udp 0 0 *:9090 *:*
udp 0 0 rx200-3:9090 *:*


The first line is a socket that is created by ConnectorHandler.connect.
The second line is a socket that is created by DatagramSocketClient class.
The third line is a socket that is created by grizzly controller (server part).

Everything is OK for me.

I tested your program on Windows, and sometimes the result was as same as Linux,
but sometimes the result was

Wait for 2000(ms)
current thread: Thread[server-WorkerThread(1),5,Grizzly], Request: hello world-1
current thread: Thread[server-WorkerThread(3),5,Grizzly], Request: hello world-2
current thread: Thread[server-WorkerThread(4),5,Grizzly], Request: hello world-3
current thread: Thread[server-WorkerThread(5),5,Grizzly], Request: hello world-4
current thread: Thread[server-WorkerThread(6),5,Grizzly], Request: hello world-5
current thread: Thread[server-WorkerThread(7),5,Grizzly], Request: hello world-6
current thread: Thread[server-WorkerThread(8),5,Grizzly], Request: hello world-7
###Binding duplicated socket again..###
current thread: Thread[server-WorkerThread(9),5,Grizzly], Request: hello world-8
current thread: Thread[server-WorkerThread(10),5,Grizzly], Request: hello world-9
current thread: Thread[server-WorkerThread(11),5,Grizzly], Request: hello world-10
           :

This is a problem (at least for me).

Thanks.


Minoru