(define port 9000) (define (main) (let ((l '?) (sd '?) (ret '?) (line "")) (set! l (tcp-listen port )) (display "*** listening ***") (newline) (while #t (set! sd (tcp-accept l)) (display "*** client connection established ***") (newline) (set! line (tcp-readline sd)) (while (not (eof-object? line)) (display "received: ") (display line) (set! ret (tcp-writen sd line (string-length line))) (set! line (tcp-readline sd))) (tcp-close sd) (display "connection with client closed!") (newline)))) |
Georg P. Loczewski 2003-07-18 |