1
votes

i want to send record with ICS (Internet Component Suite) from client to server i have a record

PIPCDataPhone = ^TIPCDataPhone;                        
TIPCDataPhone = record                                     
  cmd: string[15];                                       
  Mode: Integer;                                          
end;

i want to sent that record to server using the protocol TCP

thanks

2

2 Answers

0
votes

This focuses on Indy suite of components but please look here at the principle.

Basically, you need to write your record to the socket buffer, telling it how big it is. then on the receive side, you receive the sent number of bytes and cast it to the record type.

http://delphi.about.com/od/internetintranet/l/aa020403a.htm

0
votes

try

TClientSocket.socket.sendstream

but in this case you will have to manage the sent data, and the memory.