
19 Jan
2011
19 Jan
'11
10:19 p.m.
Hi, Originally, my idea for networking programming is like: read some bytes, judge if this is enough for a packet (defined in certain protocol), if not, read more until the packet is complete, then parse it into a message. Now we have lazy in Haskell. Can I do it as: buffer <- hGetContents handle (message1, leftData1) <- parse1 buffer (message2, leftData2) <- parse2 leftData2 ... -- 竹密岂妨流水过 山高哪阻野云飞