On 7/17/2015 10:16 AM, Matthias Felleisen wrote:
On Jul 17, 2015, at 9:31 AM, mazert <rom...@elgeekador.net> wrote: > #lang racket > > (define (foo) > (let* ([a (thread (λ () > (let-values ([(p-in p-out) (tcp-connect "google.com" 80)]) > (kill-thread b))))] > [b (thread (λ () > (sleep 2) > (printf "I'll kill you !") > (kill-thread a)))]) > (void))) #lang racket (define (foo) (letrec ([a (thread (λ () (let-values ([(p-in p-out) (tcp-connect "google.com" 80)]) (printf "I will kill b\n") (kill-thread b))))] [b (thread (λ () (displayln `(hello world)) (sleep 2) (printf "I'll kill a\n") (kill-thread a)))]) (void))) This actually works. But I am not sure why you'd want to do something like that.
Won't the connection attempt eventually time out and cause an exception when the TCP stack closes the socket? I know the default connect timeout is rather long though (150 seconds?).
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. For more options, visit https://groups.google.com/d/optout.