I am converting a delphi program to lazarus. The Delphi program uses tclientsocket.
the on read event is
procedure TClientTestFrm.ClientSocket1Read(Sender: TObject; Socket: TCustomWinSocket);
xxxxx
begin
buffer_len:=socket.ReceiveLength; // so it is set on the repeat loop
while buffer_len>0 do
begin
inbuffer:=@FrameData[bytes_rcvd]; // where to put the data
block_bytes_rcvd:=(socket.ReceiveBuf(inBuffer^,buffer_len));
bytes_rcvd:=bytes_rcvd+block_bytes_rcvd;
if (block_bytes_rcvd<0) and (buffer_len>0) then
ShowMessage ('No data');
// check for sync data and react
// check for end of data and react
buffer_len:=socket.ReceiveLength; // is there another block
end; //while
end;
I don't see the equivalent of the ..ReceiveLength even though the
.get requires a size input.
how does the onRecieve and get work in lnet.
thanks very much.
robert