On Tue, 09.02.10 20:41, Tristin Celestin (tristin_celestin at yahoo.com) wrote: > Why do I have to explicitly check inside the loop to see if the > stream is ready, and then break? Do I have to have called wait() > while the callback executes? To express in a little different words what Colin already said: Each _wait() invocation in your control thread will sleep until the next _signal() call from your IO thread. Since your state callback probably calls _signal() on each context state change this means that when you are already connected and then call _wait() again you will stay stuck, because then no more state changes will happen (unless the connection is terminated, maybe because a cable was unplugged or so) and hence no _signal() calls either. Lennart -- Lennart Poettering Red Hat, Inc. lennart [at] poettering [dot] net http://0pointer.net/lennart/ GnuPG 0x1A015CC4