Dmytro Lendel 1 Posted July 13, 2020 Hello, How to send byte array with TWSocketClient? I have byte array buffer: array[1..133] of byte I found method Send but it`s working with TBytes PFirmWare = ^TFirmWare; TFirmWare = record buffer: array[1..133] of byte; end; -------------- procedure THWClient.SendXModemLine(Line: integer); var buffer : TBytes; begin if Assigned(SocketClient) then begin if (SocketClient.State=wsConnected) then begin SetLength(buffer, Length(PFirmWare(FXmodemFile.Items[Line])^.buffer)); Move(PFirmWare(FXmodemFile.Items[Line])^.buffer, buffer, Length(PFirmWare(FXmodemFile.Items[Line])^.buffer)); SocketClient.Send(buffer,Length(buffer)); <-- AV is here end; end; end; Can you help me please? Regards Dmytro Share this post Link to post
Attila Kovacs 629 Posted July 13, 2020 Move( PFirmWare(FXmodemFile.Items[Line])^.buffer, buffer[0], Length(PFirmWare(FXmodemFile.Items[Line])^.buffer) ); Share this post Link to post