Thursday, March 25, 2010

Sending the array of arbitrary length through a socket. Endianness.

Programmer Question

Hi everyone,



I'm fighting with socket programming now and I've encountered a problem, which I don't know how to solve in a portable way.
The task is simple : I need to send the array of 16 bytes over the network, receive it in a client application and parse it. I know, there are functions like htonl, htons and so one to use with uint16 and uint32. But what should I do with the chunks of data greater than that?



Thank you.



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails