On Fri, Feb 5, 2010 at 9:23 AM, mk <span dir="ltr"><<a href="mailto:mrkafk@gmail.com">mrkafk@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

On paramiko mailing list I got the suggestion to build a timer and then quit this by myself:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The timeout option in connect() is for the socket, not for the entire<br>
operation. You are connected, so that timeout is no longer relevant.<br>
You would probably have to wrap the transport.connect() method in a<br>
timer to break out of this early.<br>
</blockquote>
<br>
Question: how can I do that? Use another threaded class? Is there some other way?<br></blockquote><div><br></div><div>What OS? Does this have to be OS-independant? Are you using more then one transport/SSLClient in your process and you want to just kill one (and any of its child threads), or are you doing one per process?</div>

<div><br></div><div>If you want to terminate -all- threads your process is running in a given timeframe, using a SIGALRM in the signal module will do it, I believe-- provided you don't need to support windows. I had a contextlib manager do that for awhile. If you only want to terminate one (and its child-threads)... you're out of luck, I think. The only way to terminate a thread in Python is with conditions/events/whatever and the thread cooperating and exiting on its own.</div>

<div> </div></div><div name="mailplane_signature">--S</div>