Heterogenous network stream

17 Oct
2010
17 Oct
'10
8:31 a.m.
Hi cafe, I'd like to implement a toy-protocol and I'm looking for the sanest way (for me) to do so. Here's what it looks like: The server receives, in that order: - Ascii string (4 bytes) - 16 bits int (2 bytes) - 8 bits int (1 byte) - UTF8 string (128 bytes) I tried to use hGetBuf, but I don't know if it's the way to go and I did not understood what to do with the buf::Ptr a argument. I'm not very concerned about efficiency. I don't know how I should convert my 16 and 8 bits int (read as Chars, I guess) to an Int. Is there something for that in the standard library? As I also write the client, I'm looking for a conversion in both ways. Thanks, -- Charles-Pierre
5332
Age (days ago)
5332
Last active (days ago)
0 comments
1 participants
participants (1)
-
Charles-Pierre Astolfi