Click to See Complete Forum and Search --> : sockets


sampath_t
February 25th, 2003, 07:43 PM
I am writing a client/server program using win32API.
I need to send some data stored in a memory buffer (accessible using a pointer) by sockets.
I was wondering whether do I have to convert the data initially in to a byte array and also do I have to divide the data in to packets.

I have a working client/server (basic) program using winAPI.

Thanks,

Sampath.

mwilliamson
February 25th, 2003, 10:23 PM
No, you will need to send it in a byte or char array. Windows will automatically split it and join it for you.

Richard.J
February 26th, 2003, 11:18 AM
You needn't convert it to a byte/char array. If the data is stored in memory, just pass the pointer to the beginning of the memory to send. You will have to cast the pointer to (void *).