On Thu, May 5, 2011 at 3:20 PM, Eric van der Maarel <eric.vandermaa...@nedap.com> wrote: > Hi, > > Further investigation reveals a difference between running Tomcat on > Linux and Windows. From the Tomcat Poller thread the apr_pollset_poll() > is called. When a client in the pollset has disconnected, under Linux > this call returns (in the rtnevents member of the descriptors resultset) > 49 (=0x31, so that would be APR_POLLIN | APR_POLLERR | APR_POLLHUP), > while under Windows this always return > 1 (so APR_POLLIN) > > The poller in Tomcat reacts on the APR_POLLHUP result, so differently on > Windows than on Linux. I think the problem lies in the missing > APR_POLLHUP in the poll return result under Windows (from the > impl_pollset_poll implemented in select.c by the way). > > Anyone any idea why on Windows (select.c) the rtnevents does not have > the APR_POLLHUP flag up, while on Linux (no idea which poll provider > version is used ther :-) this flag is set when the client has disconnected? > And how to fix? :-)
select() has a simpler view of things; normally something needs to read from the readable socket, get connreset or equiv, and handle closed connection at that point select() on any platform can't set APR_POLLHUP as a return event maybe getsockopt(SOL_SOCKET/SO_ERROR) when socket is readable and APR_POLLHUP was requested would give the necessary info???? --/-- are you sure select() is being used? newer Windows should have WSApoll()?????