
10 May
2013
10 May
'13
12:34 p.m.
Hey, I am trying to write a small haskell application which forwards udp messages. The complete program is here: http://hpaste.org/87681 Notice the lines: 43 (msg,bytes,addr) <- recvFrom sock 1024 44 putStrLn $ "Received: " ++ show bytes ++ " = " ++ (show . length $ msg) If I understand correctly, bytes is the number of bytes in the message. This should be äquivalent to (length msg), correct? Now I send an udp message (by connecting over the forwarded port with enet), and get this output: Received: 52 = 41 than I run it again, and get this output: Received: 52 = 43 Why is the length of msg not equal to 52? And why is it different from run to run? enet is unable to connect over this forward, by the way. Thanks! Nathan