Skip to main content
Home Forums 68kMLA Help with TCPExample in Pascal — #5
Post #5 by mactjaap
Source Forum68kMLA
CategoryDevelopment
Post DateSat, 19 Oct 2013 - 17:41
Original URLhttps://68kmla.org/bb/threads/help-with-tcpexample-in-pascal.29110/
Post
Ok. Before I start on such a major change I would like to send data to my opened nc port. Now it is working that on a connection data is send back. I would like to manipulate the TCPexample so that it can send data.

I listen on port 84

Code:
#nc -l 84
Thenm I connect with TCPexample to the port.... How to send over data?

I tried just the part where the finger username is in the example, but nothing happens:

Code:
     C_Established:  begin { Happens once per succesful connection establishment }
      writeln('Connection Established');

      s := concat(user_name, cr, lf, cr, lf);

      if oe <> noErr then
      CloseConnection(cp); { Better close the connection if we can't send anything to it! }
     end;
teh I looked in the origional code and saw that I just forgot one line after ....s := concat(user_name, cr, lf, cr, lf);

Code:
s := concat(user_name, cr, lf, cr, lf);
oe := TCPSend(cer.tcpc, @s[1], length(s), true);
So now I changed the username variable to

Code:
get /
and the port to 80.

Now TCP Example becomes a browser. It will get the default page on my server.

Later.... I will let it get the home page of 68kmla.org.... the we have a very simple browser!

mp.ls