I need to send an array of bytes to client connected to TIdTCPServer, I try with:
and I get memory error I try few scenarios with write but same error is here :-(
Is there some solution to send bytes, because another site is hardware with firmware who need array of bytes in TCP connection.
Thanks for the help and assistance in the advance...
Code:
procedure TFServer.btnSendClick(Sender: TObject);
var
tmpList : TList;
contexClient : TidContext;
i : integer;
begin
try
tmpList := IdTCPServer.Contexts.LockList;
finally
IdTCPServer.Contexts.UnlockList;
end;
i := 0;
while ( i < tmpList.Count ) do begin
contexClient := tmpList[i];
contexClient.Connection.IOHandler.WriteBufferOpen;
try
contexClient.Connection.IOHandler.WriteLn(#$ea#$89#$ef);
except
contexClient.Connection.IOHandler.WriteBufferCancel;
end;
contexClient.Connection.IOHandler.WriteBufferClose;
i := i + 1;
end;
end;
and I get memory error I try few scenarios with write but same error is here :-(
Is there some solution to send bytes, because another site is hardware with firmware who need array of bytes in TCP connection.
Thanks for the help and assistance in the advance...