Guest_imported
New member
- Jan 1, 1970
- 0
I've been reading up on some examples of how to receive data from the connection. Now, here's a snippet from one of the examples i'm looking at (this is in the Client's OnRead event using a TClientSocket:
var
MsgLen : integer;
Buf : string;
LenReceived: integer;
begin
MsgLen := Socket.ReceiveLength;
SetLength( Buf, MsgLen );
LenReceived := Socket.ReceiveBuf( Buf[1], MsgLen );
Buf := Copy( Buf, 1, LenReceived );
Could someone explain what's going on here? I'm slightly confuse as to what's happening and i'm fairly new to Delphi so a simple explanation would be great.
var
MsgLen : integer;
Buf : string;
LenReceived: integer;
begin
MsgLen := Socket.ReceiveLength;
SetLength( Buf, MsgLen );
LenReceived := Socket.ReceiveBuf( Buf[1], MsgLen );
Buf := Copy( Buf, 1, LenReceived );
Could someone explain what's going on here? I'm slightly confuse as to what's happening and i'm fairly new to Delphi so a simple explanation would be great.