Instead of having wxWebSessionCURL run a worker thread that uses curl to monitor and process network activity, set up a separate socket poller class to monitor socket activity. The socket poller class will throw an event back to wxWebSessionCURL when it detects activity on the sockets so that it can tell curl to process the activity in the main thread.