Re: [racket-users] Re: Detecting broken inbound TCP connections

2022-07-05 Thread Jeff Henrikson
Thanks Tony, I can confirm that eof-evt promptly delivers the expected information about the dropped TCP connection. Can an application promptly find out about dropped connections from any available HTTP library for racket? Jeff Tony Garnock-Jones unread, Jul 2, 2022, 9:23:51 AM (2

[racket-users] Re: Detecting broken inbound TCP connections

2022-07-02 Thread Tony Garnock-Jones
Ah, sorry, try `eof-evt` instead of `port-closed-evt`. When I swap the one for the other, your program gives the output you expected. Perhaps port closing is something for the Racket program to do, and is separate from the signalling from the remote peer. You'll get an `eof-object?` value from

Re: [racket-users] Re: Detecting broken inbound TCP connections

2022-07-01 Thread George Neuner
Hi Jeff, Note that most network problems result in an exception ... which your code is not catching and which you might have missed seeing in the output.  You need to catch *exn:fail:network* and examine the *errno* field to figure out what happened. * errno* is a cons: *( integer . symbol

[racket-users] Re: Detecting broken inbound TCP connections

2022-07-01 Thread Jeff Henrikson
Hi Tony, Thanks for offering your interpretation of the racket reference manual.  Below is my attempt to test whether or not the input port does indeed become closed when the TCP connection is broken. The broken TCP connection is provided by combining curl with GNU coreutils timeout. I

[racket-users] Re: Detecting broken inbound TCP connections

2022-07-01 Thread Tony Garnock-Jones
Hi Jeff, On Thursday, June 30, 2022 at 8:34:44 PM UTC+2 Jeff Henrikson wrote: > How do I accept an inbound TCP connection so that once I am processing > it, if the connection is broken by the client or network, my program > promptly finds out? > You can use `tcp-listen` and `tcp-accept` [0]