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 days ago)
to Racket Users
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 read routines when the connection closes.

On 7/1/22 5:40 PM, George Neuner wrote:
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 )*  of the error code and a symbol identifying the platform for which the error has meaning.  The codes are (somewhat) platform dependent so you will need other references to decode them.

For more, see:

  * 
https://docs.racket-lang.org/reference/exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn%29%29
  * 
https://docs.racket-lang.org/reference/exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3anetwork~3aerrno%29%29


Hope this helps,
George


--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/975b1936-107c-d525-ab06-c2ba4dcf4cd1%40gmail.com.

Reply via email to