Xojo.Net.HTTPSocket broken with R4

I just opened a project of us with the new R4 release.
Something must be broken with the Xojo.Net.HTTPSocket.
The PageReceived event is fired immediately after calling the .Send method and the content is always empty.
Same project(s) is/are working totally fine with R3.

Is anyone else experiencing this behaviour?
I’ll try to make a small sample project.

I see it working on mac. Used the examples it didn’t seem to work, but it requires “https” on mac and the example uses jsontest.com which server is erroring out.

It does work if you use a secure url or set the plist entry for “http”, i’ll test this later on windows too.
You can set if the certificates must be validated or not.

If i put a MsgBox err.Reason in the error event of the socket i get this:

Within the example supplied by Xojo, but the examples are lacking this making it seem it isn’t working.

Have any of you noticed if this is specific to the method? I.e. GET, POST, etc…

I’m using get or GET both working normally.
If i catch the error() event on mac i see it requires secure connection. Xojo.net.httpsocket is this one

Did you try to use URLConnection instead ?

[quote=417640:@Derk Jochems]I’m using get or GET both working normally.
If i catch the error() event on mac i see it requires secure connection. Xojo.net.httpsocket is this one[/quote]
Right. On macOS you’ll need to use a secure connection or specifically add a plist entry declaring that insecure connections are okay.

I’m using Windows.

No. I simply wanted to start our (working) project with the new R4.
Unfortunately no time at the moment to investigate the issue further.

[quote=417753:@Stefan Adelsberger]I’m using Windows.

No. I simply wanted to start our (working) project with the new R4.
Unfortunately no time at the moment to investigate the issue further.[/quote]

Are you catching the error event ?

The error event doesn’t get fired.
After calling the Send method the PageReceived is fired immediately with HTTPStatus 200 but no content.

[quote=417760:@Stefan Adelsberger]The error event doesn’t get fired.
After calling the Send method the PageReceived is fired immediately with HTTPStatus 200 but no content.[/quote]

What url are you calling if i may ask?

Read the r4 release notes and you will know this is NEW in r4…

https://docs.xojo.com/Resources:2018r4_Release_Notes

The new URLConnection class (part of API 2.0) is an updated version of HTTPSocket and Xojo.Net.HTTPSocket used for web communications
https://docs.xojo.com/URLConnection

I know what the new URLConnection class is but this doesn’t matter.
The existing Xojo.Net.HTTPSocket (which I want to use) is broken with the latest R4.

Have you tried other URLs?

With Windows 10 and 2018r4, I just tried these two examples: Eddie’s Electronics Desktop and HTTPSocketGetExample. Both returned the expected information. Location JSON and a map image for Eddie’s and text/JSON for the GET example. So Xojo.Net.HTTPSocket is not broken although it is apparently not working for your situation, which is a bit unknown at this point.

If you can put together a sample project and get it into Feedback this would help with troubleshooting.

My users are reporting stack overflow exceptions from those parts of my application using Xojo.net.HTTPSocket. I will be investigating today.

Do you distribute production releases compiled with 2018r4?

Alpha releases only. Based on 18 years with Xojo, I would never do a production release based on a one day old IDE and framework. Never. Ever.

For what it’s worth, I’m seeing lots of new Stack overflow exceptions with R4, though unrelated to Xojo.Net.HTTPSocket. At least probably unrelated. It does happen at app startup, which also does an update check. But the stack trace doesn’t mention the socket. For example, here’s the full trace of one such exception:

RuntimeStackCheck REALbasic.Rect.Constructor%%o<REALbasic.Rect>i8i8i8i8 EmbeddedWindowControlFinalizer EmbeddedWindowControlFinalizer CanvasDoubleBufferGetter HideMouseCursor

None of my own code in the trace. It’s not consistent, and R3 doesn’t do it either. My point is I think something isn’t quite right with R4. I’ll be skipping this release, which is unfortunate because I was intending to give URLConnection some real-world usage and get reports filed so it can get some polish for the next release.

[quote=417844:@Thom McGrath]For what it’s worth, I’m seeing lots of new Stack overflow exceptions with R4, though unrelated to Xojo.Net.HTTPSocket. At least probably unrelated. It does happen at app startup, which also does an update check. But the stack trace doesn’t mention the socket.

None of my own code in the trace. It’s not consistent, and R3 doesn’t do it either. My point is I think something isn’t quite right with R4. I’ll be skipping this release, which is unfortunate because I was intending to give URLConnection some real-world usage and get reports filed so it can get some polish for the next release.[/quote]

I think I might just do likewise.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.