15 Jun
2009
15 Jun
'09
6:21 p.m.
On Sat, 2009-06-13 at 02:01 +0200, Maciej Piechotka wrote:
I have problems with my nntp library (http://code.haskell.org/nntp/). If I try to list command it seems to fail.
Test code:
(c,p) <- connectToHost "news.example.com" Nothing forGroups c (System.IO.putStrLn . groupName) *** Exception: <socket: 6>: Data.ByteString.hGetLine: end of file
Conncection by telnet (according to wireshark): -> SYN <- SYN, ACK -> ACK <- NNTP Helo Message -> ACK
Connection by Haskell: -> SYN <- SYN ACK -> ACK <- NNTP Helo Message -> ACK <- FIN ACK (after 10 s) -> ACK
If I try to run by hand the commands in ghci I get mixed results (sometimes works sometimes it fails).
Apparently I needed to flush the stream despite having line buffering. Regards