Le Tue, 12 Jan 2010 04:49:23 +0200, hakan eryargi <[email protected]> a écrit :
> > As far as I understand the way NIO works, when the clinet has > > brutally closed the connection (ie, no FIN), the selector won't be > > informed about any modification regarding this socket, so its > > SelectionKey will never be returned on a select() operation. > > > just for curiosity, is this different from a blocking socket > connection ? i mean, is there something different for NIO that it cant > detect a disconnected client but a blocking server can ? > Hi, If there is a TCP level end of connection MINA will detect it as all other network libraries. If there is no TCP end of connection (net cable unplugged, power down), the connection can be idle for hours. The only way to detect it is using idle time. It's the same for *ALL* the nio, bio, poll, epoll, whatever way of using TCP sockets. It's the way TCP negotiate end of connection. Julien > On Tue, Jan 12, 2010 at 4:17 AM, Emmanuel LŽcharny > <[email protected]> wrote: > > > > Patrick Sansoucy a écrit : > >> > >> Sorry to jump on the thread, but I'm a bit surprised by (and > >> curious about) the behavior exposed here and the fact that Mina > >> does not detect it ... > >> > >> Is the connections between your 2 boxes direct (ie no proxy or > >> firewall) because I witnessed a couple of years ago the exact same > >> behavior with one of our application and we found out that the > >> issue was that a proxy was leaving the socket hanging there making > >> the client or server think it was still active. > >> > >> From what I remember from our diverse implementation at work (I am > >> not familiar with Mina's inner working). I think the poll would > >> indicate something occurred and a read confirm the socket closing > >> (cleanly or not). > > > > As far as I understand the way NIO works, when the clinet has > > brutally closed the connection (ie, no FIN), the selector won't be > > informed about any modification regarding this socket, so its > > SelectionKey will never be returned on a select() operation. > > > > I any case, we don't poll. > > > > Am I missing something ? -- Julien Vermillard Archean Technologies http://www.archean.fr
signature.asc
Description: PGP signature
