I’ve got an odd issue with “URLConnection”. I wrote a small test WebApplication that uses URLConnection to perform a HTTP GET.
This test application fails when run on a Raspberry Pi but works when run on Ubuntu. “libsoup2.4” is installed on both Raspbian and Ubuntu.
When the application fails on Raspbian, it simply drops out of the debugger without throwing an exception. So I have no way to see what the problem might be.
On Raspbian, when I issue the “SendSync” command, the “AuthenticationRequested” event isn’t fired and the application dies without any indication why.
On Ubuntu everything completes and I receive the results of the HTTP GET.
Has anyone else seen this?
PS. I finally gave up and reverted to the old-school “HTTPSocket.Get” which works fine on both Raspbian and Ubuntu.
I would like to use URLConnection because I’m making an effort to adopt the new Xojo API but it doesn’t look like I can in this case.
It might have something to do with raspberry pi using 32bit libraries. Maybe see if you can capture the error in App.UnhandledException, I find sometimes the debugger can’t properly handle some exceptions but if you build the app it shows up in UnhandledException. Double-check that it’s failing exactly on SendSync and not when you are trying to read headers or such.
The problem can be reproduced consistently if certain conditions are met:
Project is executed with “Project | Run Remotely | <name of your debugger host>”
The debugger host is a Raspberry Pi.
The URLConnection host must require authorization.
A breakpoint is set withing the “AuthorizationHandler” method.
If you remove the breakpoint from the AuthorizationHandler method the project will execute without perfectly without crashing/quitting.
The RemoteConsoleDebugger does not issue any stderr or stdout messages to its terminal window that would indicate a problem. The program simply crashes/quits.
If this project is executed on a Ubuntu system, a breakpoint can be set in the AuthorizationHandler method and the breakpoint works without crashing/quitting.
It doesn’t crash when run from a terminal (without the debugger.) It only crashes when the RemoteConsoleDebugger is being used.
I have run the RemoteConsoleDebugger in a terminal window and it only emits the usual messages about my program being uploaded etc. Then when the program crashes, the debugger just says that my program has ended.
How about this… have you implemented App.UnhandledException? If so, could you have it write the stack to a file?
My guess is that there is something that’s different because of the debugger stub… like a file isn’t where you expect it to be, or the working directory is different, or something like that.
I’ve just tested a URLConnection on a NanoPi and RaspberryPi both work.
Must have “libsoup2.4-1” and “libunwind8”.
Test SendSync and Send (async) both worked in the prerelase.
Can you verify @Wes_Westhaver ?
i’ve tested on https://httpbin.org/get?test=1234
Not sure if the problem could be “https” or “http”
if “http” tou may want to set