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 not work:

        (for ([line (in-lines in)])
             #:break (eof-object? line)
          ...)

Neither does this (which I wouldn’t expect to work, after the above didn’t):
        (let loop ([val (read-line in)])
          (unless (eof-object? val)
            ...))

I’ve determined that the eof-object? calls are never producing #t, even if ^D 
is the very first thing the client sends. I’m thinking there’s something 
super-basic that I’m forgetting.

What am I missing here?

Thanks,
Jordan

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to