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 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.


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 )*  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/31a25463-eb1e-2f05-920a-7cfa49e33f99%40comcast.net.