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 usingXojo.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 toHTTPSecureSocket
(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 usedXojo.Net.HTTPSocket
on Mac but reverted to the olderHTTPSecureSocket
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.
- Switch to URLConnection: Xojo and community members recommend using the newer
- 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:
- Xojo.Net.HTTPSocket problem when Network is not Available. Error Handler freezes the entire App - General - Xojo Programming Forum
- Building a server into your app — Xojo documentation
- Internet communications — Xojo documentation
- SocketCore — Xojo documentation
- https://www.youtube.com/watch?v=s7Y-BrSnJ_w
- The ZAZ: Xojo Has an HTTP Problem
- Communicating via TCP/IP — Xojo documentation
- Troubleshooting connection issues | Socket.IO
- WebApplication — Xojo documentation
- Xojo Web App Just Freezes (no errors, no crashses) - Web - Xojo Programming Forum
- Is Xojo Web Performance REALLY that bad?
- Web 2.0 - when using HTTPS initial page load is 500msec slower - Web - Xojo Programming Forum
- https://nug.xojo.narkive.com/ao0GmbeW/we-weblistbox-performance-adding-large-number-of-rows
- Socket Xojo Plugin Reference Documentation
- Multiple SSLSocket I/O in Threads: the slowest connection universally sets the pace for all connections - General - Xojo Programming Forum
- REALbasic Sockets ReadMe
- Article 20201: : News
- https://www.chilkatforum.com