<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">use multiple threads (one to do the connect, and one to listen to Tor controller events and assign the stream to the circuit)</blockquote>

<div><br>You are a genius! (An I&#39;m and an idiot because I didn&#39;t found this solution by self!)<br></div></div><br>I will post final solution after it will works. Currently there is at least one problem, because after calling attach_stream from another thread (and Tor returns me SENTCONNECT event), calling of socket.connect() is still blocking and Tor never send me SUCCEEDED (which I expect as confirmation of SENTCONNECT). I&#39;m right? What can I do wrong?<br>
<br>Current situation is:<br><br>1) Create circuit (main thread) -- OK<br>2) Call socket.connect() (main thread) -- OK<br>3) call ctl.attach_stream() from Tor callback handler (it is separate thread) instead of waiting on stream_id in main thread. It causes to SENTCONNECT event (with correct stream an circ id), but main thread is still blocked and Im missing SUCCEEDED event as confirmation...<br>
4) Then, socket.connect() should return socket in main thread, but it never happen.<br><br><br>Thanks :-)<br>
Marek<br>