Xojo Socket Control

The Xojo Socket control seems to have a lot of issues.

What is everybody else doing to work around this? MBS?

In case anyone stumbles upon this, or it gets indexed by the web, I’m going to post this here. It’s a perplexity search for the exact issue, and I’d like it to be public, and I know that it won’t stay up on the forum.

Xojo HTTP Socket Lockup Issue in Web Applications

Summary:
There are known issues in Xojo where HTTP socket operations, particularly when waiting for a request or when network conditions are poor, can cause an entire web application to become unresponsive or “lock up.” This behavior has been reported with both Xojo.Net.HTTPSocket and URLConnection classes, especially when used asynchronously but encountering network failures or DNS resolution errors.

Details and Evidence:

  • Application Freezing on Socket Wait:
    Users have reported that when using Xojo.Net.HTTPSocket for asynchronous HTTP requests, if the network is unavailable or DNS resolution fails, the entire application can freeze for 10–15 seconds. This occurs even though the operation is expected to be asynchronous and should not block the main thread. The issue was observed in both debug and built applications, and switching to HTTPSecureSocket (now deprecated) did not resolve the problem1.
  • Underlying Cause:
    The freezing seems to be related to how Xojo’s HTTP socket classes handle network errors and DNS lookups. While Xojo claims to use asynchronous system calls (e.g., CFHost on macOS, DnsQueryEx on Windows), in practice, the app can still hang when network conditions are poor. This suggests that the asynchronous model is not fully shielding the application from blocking operations at the system or framework level16.
  • Platform-Specific Issues:
    Reports indicate that these socket lockups are more common or severe on Windows, with some developers resorting to using different socket classes depending on the platform. For example, one developer used Xojo.Net.HTTPSocket on Mac but reverted to the older HTTPSecureSocket on Windows due to reliability issues6.
  • Community Recommendations:
    • Switch to URLConnection: Xojo and community members recommend using the newer URLConnection class, which is more robust and actively maintained. However, even this class has been reported to have similar problems in some scenarios16.
    • Manage Socket Lifetimes: Ensure socket objects are kept alive until their events (such as error or content received) are handled. Prematurely releasing socket references can cause crashes or undefined behavior1.
    • Consider Third-Party Solutions: Some developers have created their own HTTP client classes based on CURL (via plugins) to avoid Xojo’s built-in socket issues, especially for production use on Windows6.
  • Web Application Socket Limitations:
    Xojo web applications manage sockets internally for each session, and improper handling or excessive blocking in socket events can impact the responsiveness of the entire app9.

Conclusion:
Yes, there is a known issue in Xojo where an entire web application can lock up if an HTTP socket is waiting for a request or encounters network problems. This is due to limitations in Xojo’s HTTP socket implementation, particularly under poor network conditions or on certain platforms like Windows. Developers are advised to use URLConnection, manage socket lifetimes carefully, or consider third-party solutions for critical applications169.

Add to follow-up

Check sources

Citations:

  1. Xojo.Net.HTTPSocket problem when Network is not Available. Error Handler freezes the entire App - General - Xojo Programming Forum
  2. Building a server into your app — Xojo documentation
  3. Internet communications — Xojo documentation
  4. SocketCore — Xojo documentation
  5. https://www.youtube.com/watch?v=s7Y-BrSnJ_w
  6. The ZAZ: Xojo Has an HTTP Problem
  7. Communicating via TCP/IP — Xojo documentation
  8. Troubleshooting connection issues | Socket.IO
  9. WebApplication — Xojo documentation
  10. Xojo Web App Just Freezes (no errors, no crashses) - Web - Xojo Programming Forum
  11. Is Xojo Web Performance REALLY that bad?
  12. Web 2.0 - when using HTTPS initial page load is 500msec slower - Web - Xojo Programming Forum
  13. https://nug.xojo.narkive.com/ao0GmbeW/we-weblistbox-performance-adding-large-number-of-rows
  14. Socket Xojo Plugin Reference Documentation
  15. Multiple SSLSocket I/O in Threads: the slowest connection universally sets the pace for all connections - General - Xojo Programming Forum
  16. REALbasic Sockets ReadMe
  17. Article 20201: : News
  18. https://www.chilkatforum.com
1 Like

I feel for you. Only choice is to stop using Xojo… It’s really hopeless.

Comparing to Java it is simple only one thing: crap. I think that somebody writing an application in the need of sockets should be aware of this and change to C# or Java. For Web applications and especially backends it is no solution to use Xojo.

Thank you. That was amazingly helpful.

If you’re still using Xojo.Net.HTTPSocket , or HTTPSecureSocket, switch to URLConnection - its a much more direct mapping to the OS provided services all around

In the apps where I’ve used URLConnection its been reliable
Never had it get to be unresponsive

We switched away from HTTP Socket as it would occasionally have issues that URL Connection didnt when accessing vendor API’s

That said this client is moving away from Xojo due to issues across the board in all aspects of their offering most notably on Android

3 Likes

You keep going round and round with Xojo. It’s not going to stop happening until you take action.

What would it take for you to give up on Xojo?

7 posts were split to a new topic: Dealing with Xojo issues by moving to something else