[gambit-list] Tcp server error?

vasil vasil.s.d at gmail.com
Mon Aug 24 13:38:04 EDT 2009


Try this code:

(define (tcp-server-test)
  (let ((p (read (open-tcp-server (list server-address: "*:2000"
reuse-address: #t)))))
    (pp (read p))
    (write 'yea! p)
    (force-output p)
    (close-port p)))


Vasil.



David St-Hilaire пишет:
> Hi all!
> 
> Can anyone help me pinpointing what is wrong with the follow tcp server 
> code?
> 
> (define (tcp-server-test)
>   (let ((p (read (open-tcp-server (list port-number: 20000 
> reuse-address: #t)))))
>     (pp (read p))
>     (write 'yea! p)
>     (force-output p)
>     (close-port p)))
> 
> (tcp-server-test)
> 
> If run this code inside a console and, from another console I run the 
> following client code:
> 
> (define (tcp-test)
>   (let ((connection
>          (open-tcp-client
>           (list server-address: "192.168.60.239"
>                 port-number: 20000))))
> 
>     (write 'allo!! connection)
>     (force-output connection)
>     (read connection)
>     (close-port connection)))
> 
> (tcp-test)
> 
> I always get a "broken pipe" error. Note that the ip address is correct. 
> I tried to replace the server with the good old netcat and it works just 
> fine (i.e. that the client successfully connects to the nc server). Is 
> anything wrong with the server code?
> 
> Thanks!
> 
> --
> David
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
> 




More information about the Gambit-list mailing list