[racket] help simple networking

From: kty1104 at gmail.com (kty1104 at gmail.com)
Date: Fri Oct 8 01:56:12 EDT 2010

I am making simple networking program, server and client
but it doesn't working properly
the "received" string is displayed on server side
but that's not a my intention
I try to give and take variables but fails again and again
could somebody please let me know what I have to do?

server source:
#lang racket
(require racket/tcp)
(define listener (tcp-listen 12345))
(let echo-server ()
(define-values (in out) (tcp-accept listener))
(display "received")
(display (read in))
(thread (lambda () (copy-port in out)
(close-output-port out)))

client source:
#lang racket
(define-values (in out) (tcp-connect/enable-break "localhost" 12345))
(display "1" out)(display "2" out)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20101008/c7103862/attachment.html>

Posted on the users mailing list.