[gambit-list] open-tcp-client behavior

François Magnan francois.magnan at licef.teluq.uqam.ca
Mon Feb 19 11:59:58 EST 2007


Hi,

I am currently working on a multi-platform project and I stumbled on  
a difference in the behavior of open-tcp-client between MacOSX and  
Windows (MinGW)  using Gambit-C 4.0 beta20. The difference occurs  
when I open a connection to an address where no server is running and  
try to read from it. In MacOSX I get an exception and in Windows I  
get an infinite loop.

Here is a trivial test:

(define (test-tcpclient)
   (let ((p (open-tcp-client (list server-address: "127.0.0.1"
                                   port-number: 8087
                                   eol-encoding: 'cr-lf
                                   ))))
     (display "test\n\n" p)
     (read-line p)))


On MacOSX I get:

*** ERROR IN ##read-line -- Connection refused
(read-char '#<input-output-port #3 (tcp-client "127.0.0.1" 8087)>)

On Windows I get an infinite loop waiting for the read-line to  
terminate.

I know I can put some timeout on the read-line but I think the MacOSX  
behavior is the correct one.

Thank you,
Francois Magnan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20070219/3291ad79/attachment.htm>


More information about the Gambit-list mailing list