Skip to main content
Home Forums 68kMLA Help with TCPExample in Pascal — #3
Post #3 by mactjaap
Source Forum68kMLA
CategoryDevelopment
Post DateFri, 18 Oct 2013 - 23:23
Original URLhttps://68kmla.org/bb/threads/help-with-tcpexample-in-pascal.29110/
Post
Thanks bbraun for the help! I now understand better!

I changed to your advice. I started to use nc, the "Swiss knife" network tool. This is indeed more transparent.

I started it up as a kind of mini web server with the command:

Code:
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; cat index.html; } | nc -l 84; done
This will send the file index.html with an HTTP header to anything what connects to port 84. This could also be my TCPExample. I tested it first with nc itself in an other console:

Code:
nc localhost 84
Then I edited my pascal code like this:

Code:
 const

 dest_name = 'live.net2service.com';
 dest_port = 84;

 nul = chr(0);
 lf = chr(10);
 cr = chr(13);
Test the new executable:

TCPExample as a Browser App.zip

See all the code:

TCPExample as a Browser.zip

Now I'm on my way!

I would like to know if I can switch the current code to something what listens to a port and sendout a file if asked. Just like nc is doing in my mini web server?

mp.ls