PasteRack.org
Paste # 3883
2013-10-08 00:52:59

Fork as a new paste.

Paste viewed 2465 times.


Embed:

echo server

  1. #lang racket  ; An echo server
  2. (define listener (tcp-listen 12345))
  3. (let echo-server ()
  4.   (define-values (in out) (tcp-accept listener))
  5.   (thread (lambda () (copy-port in out)
  6.                      (close-output-port out)))
  7.   (echo-server))

=>

tcp-listen: network access denied: '(#f 12345 server)

listener: undefined;

 cannot reference an identifier before its definition

  in module: 'program