users@grizzly.java.net

Re: why there is an unknow connection when starting a nio server?

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 23 May 2008 11:11:58 -0400

Hi,


Ken--_at_newsgroupstats.hk wrote:
> I know this problem may not due to Grizzly but what I want to know is..
> whenever I start a nio server by using java.nio package, there exist a
> strange connection with no listening port! Please read the attached screen
> shot.

For Alan Bateman, NIO leads:

A Selector on Windows has a loopback connection that is used for the
wakeup mechanism. Hence every Selector created will show what you just
discovered.


It it a problem? The SelectorFactory initialize by default a pool of
Selector. We have fixed that recently. Which version of Grizzly are you
using?

Thanks

-- Jeanfrancois

>
> The original problem is, I have my own nio framework (developed in 3-4 years
> ago). My server is running very well on first 3-4th day but after certain of
> time, the server will create many unknown connections like this:
>
> TCP 127.0.0.1:2408 127.0.0.1:2409 ESTABLISHED
> TCP 127.0.0.1:2409 127.0.0.1:2408 ESTABLISHED
> TCP 127.0.0.1:2410 127.0.0.1:2411 ESTABLISHED
> TCP 127.0.0.1:2411 127.0.0.1:2410 ESTABLISHED
> TCP 127.0.0.1:2412 127.0.0.1:2413 ESTABLISHED
> TCP 127.0.0.1:2413 127.0.0.1:2412 ESTABLISHED
>
> before the server go down, it around has 5000 pairs of this kind of
> connections(in windows 2003 server). That why I have to switch to grizzly.
>
> So, my question is what's those connection for? what are they?
>
> http://www.nabble.com/file/p17424006/2008-05-23_193552.gif
> 2008-05-23_193552.gif