Re: [racket-users] Detecting EOT when reading a TCP port

2017-02-22 Thread Ryan Culpepper
read-line returns eof when the port is closed, which is completely different from sending byte 04 (or any other byte or sequence of bytes) over the port. ;; set up {client,server}-{in,out} ports (write-byte 4 client-out) (flush-output client-out) (read-byte server-in) ;; => 4

[racket-users] Detecting EOT when reading a TCP port

2017-02-22 Thread Jordan Johnson
Hi all, Quick question: Given a listener and input port defined thus: (define listener (tcp-listen port)) (define-values (in out) (tcp-accept listener)) while reading lines of text, what’s the correct way to detect an EOT (^D or U+0004) character? This “obvious” solution does