hecl> set s [socket
hecl.org 80]
org.hecl.files.HeclChannel@1bd0dd4
hecl> $s writeln "GET / HTTP/1.0"
15
hecl> $s writeln ""
1
hecl> $s readln
HTTP/1.1 200 OK
hecl> $s readln
Date: Sat, 10 Apr 2010 19:41:02 GMT
hecl> $s readln
Server: Apache/2.2.11 (Ubuntu) DAV/2 SVN/1.5.4 Phusion_Passenger/2.2.5
mod_ssl/2.2.11 OpenSSL/0.9.8g
hecl> $s readln
Last-Modified: Tue, 18 Nov 2008 22:02:58 GMT
hecl> $s readln
ETag: "2120e-2d-45bfddbb88880"
Should work on all platforms.
It's an initial stab at things; there's some cleaning up that could be
done in the 'file' implementation where I stashed the code.
Logically, the streams stuff shouldn't depend on files, and sockets
shouldn't either, but on the other hand, breaking everything out into
separate classes causes bloat.
Have a look at it, let me know what you think.
--
David N. Welton
http://www.welton.it/davidw/
http://www.dedasys.com/