Roger Alcindor
asked on
Copying a binary buffer to a TIdBytes object
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(r emotehost, 10036,ABuf fer);
Thanks,
Roger
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(r
Thanks,
Roger
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found the solution myself
Open in new window
But IMHO it might be easier to pass ABuffer to 'SetupBuffer()' instead.