Running TWebSocketClient in a service worker thread instead on main thread.

Is there a way in Web Core to create and run the TWebSocketClient in a service worker thread. This issue I am seeing with using in conjunction with the TChatbox and transferring a file, the main thread locks up when both sending and receiving a file of any large size 5-6K. I'm sure it could be done in pure javascript but that kind of defeats the purpose of using Web Core.

I might be wrong but I think that browsers (Javascript) is single threaded. You might get something similar by using an Async call.

JavaScript has the concept of service workers which is a separate JavaScript file that can specified to run in a separate thread in the browser. This allows you to do long operations such as retrieving data say from a CGI call with out blocking the main thread. Data is passed back an forth using the postmessage function.

1 Like

always learning something on this forum. Thanks.