You are reading the output incorrectly, this should be done in a loop:
https://wiki.lazarus.freepascal.org/Executing_External_Programs#Reading_large_output
To avoid doing this manually, use the "RunCommand":
https://wiki.lazarus.freepascal.org/Executing_External_Programs#(Process.)RunCommand
For example, you might find the Synapse package useful:
https://wiki.freepascal.org/Synapse
>Воскресенье, 12 января 2025, 14:04 +05:00 от Duke Normandin via fpc-pascal
>:
>
>I’ve Googled my butt off looking for fpc/pascal examples
>/tutorials on writing a simple tcp client and serve