<div dir="ltr"><div><div>One simpler possibility is to use `tcp-connect/enable-break` and run a timer in parallel to break it after a shorter delay.<br></div>For example:<br><br>(define-values (in out) (values #f #f))<br><br>
(define connect-thread<br> (thread<br> (λ()(set!-values (in out) <br> (tcp-connect "<a href="http://www.google.com">www.google.com</a>" 80)))))<br><br>(sleep 3)<br>(unless in<br> (displayln "Connection not established. Breaking thread.")<br>
(break-thread connect-thread))<br><br></div><div>The timer can also be place into its own thread if you need to set up several connections in parallel.<br><br></div><div>Hope this helps,</div>Laurent<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Apr 17, 2014 at 6:48 PM, nicolas carraggi <span dir="ltr"><<a href="mailto:nicocarraggi@hotmail.com" target="_blank">nicocarraggi@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Hello,<div><br></div><div>I am actually using "Racket/tcp" for a project in Racket.</div><div>I'm creating a peer-to-peer network but now I encountered a small problem.</div><div>For a multicast I want to connect with each server on the same network. </div>
<div>For this I use "tcp-connect", but when i try to connect to an ip address which is not hosting a server, throwing the error only happens after more than 1 minute. So I would like to use a modified "tcp-connect" with a smaller time-out.</div>
<div><br></div><div>Where can I find the implementation of "tcp-connect"?</div><div><br></div><div>I already found "tcp.rkt" but there it gets the "tcp-connect" method from "'#%network" but I can't find this one...</div>
<div><br></div><div>Greetings!</div><span class="HOEnZb"><font color="#888888"><div>Nicolas</div> </font></span></div></div>
<br>_________________________<br>
Racket Developers list:<br>
<a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
<br></blockquote></div><br></div>