Using the “TCPSocket” example

I changed the value in the Address field and I always get:

Also, what value have the report if the address is not in the Error report ?

PS: I set the window Resizeable (ON), and set the Address URL Field “enlargeable” because working with stamp sized windows / fields is a pity. I will unlock the report fiel too: same reason: What if I need to copy the report contents (Error 103 IS ?)

With more changes:

It says I can connect to the default value (en.wikipedia.org), but not to a useful page (France - Wikipedia).

www.mandrakewiki.org requires SSL/TLS. This means you need to use the SSLSocket class instead of the TCPSocket class, and port 443 instead of port 80.

en.wikipedia.org/wiki/France is a HTTP URL. Use the URLConnection class to make HTTP requests.

2 Likes

Thank you.

I miss some more explanation: how do I know what is needed to do this or that ?

In a text, I may add a “link” to the base wikipedia, in another text I may neex to give a specific (full) URL.

For SSL/TLS I checked in a web browser. Most websites these days require it.

For HTTP versus plain TCP, a TCP address doesn’t have a path like /wiki/France, only the server address.

Thank you Andrew for the explanation.

I think I started with HTTP, then go the TCP road (not sure, mlemory is not what it was 50 years ago).

Doculentation lack some explanation (excepted if the prodcuct is targetted to the ones who knows: people using it for money…

Go Figure: in the current documentation, I do not find a line syain how much Ticks for a second (the answer can be 60).
You understand that between the lines of the example…

It is clearly documented.

Yes:

When you do not have the above screen, you go there:
https://documentation.xojo.com/api/deprecated/ticks.html#ticks

and no it is not documented.

The documentation gives this description for Ticks: “Returns the number of Ticks (60th of a second) that have passed since the user’s computer was started.” I’d say that’s reasonably clear. The documentation of the newer System.Ticks (that replaces the deprecated old Ticks) explains it as well, see System — Xojo documentation

The documentation for API2…

They are cutting the contents of the original API pages…
So, if you do not notice where you are (original API vs API 2), you’re in…

Both the old, deprecated Ticks and the new System.Ticks are documented in sufficient detail. Where’s the problem?

When you send a request, you’ll often get a response from the server redirecting you to the secure URL if it’s required. The response would contain lines like this:

HTTP/1.1 302 REDIRECT
Date: Mon, 23 May 2024 22:38:34 GMT
Content-Type: text/html; charset=UTF-8
Location: https://new.url.here/
Connection: close

https rather than http is the standard nowadays so you will generally need to establish a secure connection with SSLSocket. When you enter a URL in your browser it will tell you whether it’s a secure connection (and it may even refuse to connect if it isn’t).