how to read from a TCP socket line by line

Daniel Solaz dsolaz@REDACTED
Tue Aug 14 00:08:52 CEST 2001


Hello.

How does one do when there's the need to read from a TCP socket line by 
line?  I've been looking through the docs but found nothing.

Something like this would be nice:

{ok, Socket} = gen_tcp:connect(...),
Line = io:get_line(Socket, ...)

Maybe I should look at how the inets webserver parses HTTP headers 
(which BTW is exactly what I want to do, except on the client side).

-- 
d s o l a z @ L E P I D O P T E R O . C O M




More information about the erlang-questions mailing list