Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sending Byte List
#1
I need to send an array of bytes to client connected to TIdTCPServer, I try with:

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...
Reply


Messages In This Thread
Sending Byte List - by krshin - 08-22-2018, 07:19 PM
RE: Sending Byte List - by rlebeau - 08-22-2018, 08:27 PM
RE: Sending Byte List - by krshin - 08-23-2018, 05:52 AM
RE: Sending Byte List - by rlebeau - 08-23-2018, 10:32 PM
RE: Sending Byte List - by CaptRick - 08-29-2018, 11:43 AM
RE: Sending Byte List - by rlebeau - 08-29-2018, 06:22 PM
RE: Sending Byte List - by CaptRick - 08-29-2018, 10:50 PM
RE: Sending Byte List - by CaptRick - 08-31-2018, 10:38 AM
RE: Sending Byte List - by rlebeau - 08-31-2018, 05:10 PM
RE: Sending Byte List - by CaptRick - 08-31-2018, 09:02 PM
RE: Sending Byte List - by rlebeau - 08-31-2018, 09:35 PM
RE: Sending Byte List - by CaptRick - 08-31-2018, 09:46 PM
RE: Sending Byte List - by CaptRick - 09-01-2018, 12:46 PM
RE: Sending Byte List - by CaptRick - 09-04-2018, 03:35 PM
RE: Sending Byte List - by rlebeau - 09-04-2018, 06:32 PM
RE: Sending Byte List - by kudzu - 09-05-2018, 02:28 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)