At 13.16 27/10/2005 +0200, you wrote:

>Hello Geppy,
>Here is a working client example for this server:


>Rgds, Wilfried [TeamICS]

Hi Wilfried,

first of all, thank you for your time and help :)

Things are going better...

Now the server socket receive the data form your client (even if I'm still 
trying to understand what was wrong with my previous one...) but now I 
think I'm doing something wrong while I try to transfer the buffer from 
socket to my record.

In your server1 example, I modified the ReceiveBinComplete method of 
TClient as follows:

procedure TClient.ReceiveBinComplete;
   data : TData;
    Log(ltSystem, IntToStr(RcvdCount) + ' bytes received');
    WritePtr := 0;                   // get ready for next receive
    IsRcvBin := False;               // receiving of data is done
    LineMode := True;                // we are going back to command mode
    SendStr('+OK DATA'#13#10);       // tell the transmitter we have all data
    Move(Rcvd^, Data, SizeOf(Data)); // Rcvd is the pointer to the buffer
    Log(ltRx, ' = ' + data.Name);
    Log(ltRx, 'data.ID = ' + IntToStr(data.ID));

but it returns an empty record.
I don't understand why I get the exact length of received data (RcvdCount 
is 15, which is SizeOf(Data)) but Rcvd seems to point to an empty buffer.
Maybe my pointer dereferencing code is wrong?
Or should I need to use another function instead of Move()?


Geppy Piloni

To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to