Multithreading with sockets?


#1

Hey there,

I’m writing a networked app using libCURL; the problem is that each http request takes a little
while to complete which causes the UI to get unresponsive. I tried to put the libCURL code in a class that inherits from Thread - it does seem to work as in “the code executes”, but the UI stays unresponsive.

What do I have to do to give control back to the main program while libCURL is doing its magic?


#2

I wish making a multi-threaded app was as easy as just inheriting from Thread! If you’re new to threading, have a look through some example code, like in the juce demo, and use your debugger to watch things execute. And read the notes for the Thread class.