Solved
Copying a binary buffer to a TIdBytes object
Posted on 2013-01-28
I am using Indy10 with C++ builder XE2 and I want to send a packet of binary data using a UDPServer control. I have a plain buffer of data to send in an array of unsigned chars.
Can someone explain how to move data from a plain character array to a TIdBytes object
The code is as follows :
unsigned char buff[566];
TIdBytes ABuffer;
SetupBuffer(buff) // data is prepared for sending (566 bytes)
// ..... some code needed to move the buffer into the TIdBytes buffer ??
// now send the data using UDP to a remote host listening on port 10036
IdUDPServer1->SendBuffer(remotehost,10036,ABuffer);
Thanks,
Roger