Net.HTTPSocket PageReceived problem

(Ok, I’m not really sure how to title this so feel free to change it.)

I have an app where I’m calling a modal window from within the PageReceived event of a Xojo.Net.HTTPSocket. When the call to the window is made, the PageReceived handler immediately re-enters itself at the start, without waiting for the modal window to be handled. The resultant is creation of multiple instances of the modal window until a stack overflow is reached.

This worked ok in previous versions.

Interestingly, URLConnection’s ContentReceived handler works properly.

I’ve created a test app and filed a bug report.

Windows 10, Xojo 2019r1

<https://xojo.com/issue/55420>

I’ve discovered this same issue as well. It’s only happening in Windows. In OS X it is fine. Not sure about Linux.

I remember reading lots of coments on the forum sayint that is not a good idea to block a socket event with a modal window.

The best option is to retrieve the data and leave it alone ASAP.

As a workaround/alternative, you can put the content in a property and call a sub to handle it with Xojo.Core.Timer.CallLater

That shouldn’t cause a socket’s event to fire repeatedly. I understand why you might not want to put something model in the event in case you have execution blocked when new data comes in. I get it. But in the case where I am using a modal window (MsgBox), it’s with the Kaju updater and once I make the request and the data from the GET command arrives, there’s nothing else that will come in. Yet, the event continues to fire.