Path: csiph.com!news.mixmin.net!news.albasani.net!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: server-side Socket does not recognize broken connection. Date: Wed, 29 May 2019 16:06:13 +0000 (UTC) Organization: albasani.net Lines: 21 Message-ID: References: <1v9ncmqz4ep4j$.1mdftm8twalol$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net IUngXZ2VDiDSvrdJkjlJZeFW5gBE+84S9nH3OcfLLXKuH0Lr+IE9DXX8wCcT8ArR4acrB4KDArWBbv5/GOccnudaA70lGL3j/FtbUpe5PQYnA0h/66pbUxarVBFiAJbO NNTP-Posting-Date: Wed, 29 May 2019 16:06:13 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="dAK8YMgPR1DHVn8mv/kxr8t7rxnTbI1x5ByyJvvfWoCodfTXCHaOirc5XZw/tU4tCvOqjjTy5+GaXvnUDdj/l5tXLM0Rate+W5yDzjKS2ipgc8IzYmDHnt8N3JOZ1eqp"; mail-complaints-to="abuse@albasani.net" User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a git.gnome.org/pan2) Cancel-Lock: sha1:v+EEwE/Tl/6nuj9Ve9ZKcziYL4U= Xref: csiph.com comp.lang.java.programmer:38974 On Wed, 29 May 2019 14:50:14 +0000, Andreas Leitgeb wrote: > Watching the Java server with strace (on linux), I see that Java calls > the system: > ioctl(6, FIONREAD, [0]) = 0 > > Now I'm going to read up on why this syscall wouldn't report a broken > socket, and what other syscall (short of actually reading and risking > to block) would allow me to tell idle from broken. > A quick look at the man pages for ioctl(2) and ioctl_list(2) didn't tell me a lot. It seems to me that Eric's suggestion of using a blocking read to fill a queue and driving your mail processing loop off that is most likely the way to go. -- Martin | martin at Gregorie | gregorie dot org