I have an ASCII file, which looks like this:
36,36,0,1
36,36,0,2
...
What I want to do is to send every row of it as one binary TCP segment's payload with NetCat.
To convert the number from file to its binary representation I'm using Perl's print pack("c", <STDIN>);
so I can easily convert whole file (number by number). I know also how to send it with cat file | netcat localhost 9999
but this command sends whole content as payload in one segment.
What can I do to send every line of original file (converted to binary) as a new TCP segment?