HTTPSocket .Get ErrorCode 22

Dim server As New HTTPSocket
Dim result As String = server.Get(“http://update.micado.cc/test.txt”, 10)

On windows this works fine.
On Mac I get an errorcode 22.
Does anybody know why?

Using Xojo 2015r4.1

You should try to make server a property of the window or a module.

Makes no difference.

Copied your two lines of code into a new project. result is: “this is my test txt file”

OS X 10.11.6
Xojo 2016r2

Same here. It works just fine in both 2016R2 and 2015R4.1.

Error 22 being Invalid argument, chances are something is wrong in line 2.

What you posted is right, apparently. Try pasting that in your project.

Unless what you posted is just a sample, and your actual code is much more complex ?

Since this version of HTTPSocket.Get is a synchronous operation, my assumption is, that the error comes from a different operation. Maybe you use HTTPSocket.Post directly before the Get, but asynchronously instead of synchronously?

My actual code is much more complex but I could break it down to this sample project.
On Windows it works - on Mac 10.11.4 I get the error code 22.

You sample project is the same as the code in your first post. And this code works on OS X.

Though the error happens on this line, the actual root of the error must happen somewhere else before.

Sorry, no error here with the sample project.

There is nothing before.
I can also open it in Safari and other browsers (just to check that there is no network problem or something like that).

http://update.micado.cc/screenshot.png

Error 22 is a disconnect code on OS X, similar to error 102. Are you saying that “result” is not being set? Have you tried increasing the timeout?

Now it works fine again - nothing was changed.
Something strange is happening here - I’ll keep an eye on this.

[quote=280300:@Richard Grafl]Now it works fine again - nothing was changed.
Something strange is happening here - I’ll keep an eye on this.[/quote]
Keep in mind that the problem could have been on the server or somewhere in between as well.