Based on nothing more than the little you've said in your post -- ie. no first hand experience whatsoever -- it sounds like the library you are using is not thread-safe.
So, as you say "if I run it in main,it runs well.", why bother trying to run it in a thread?
That is to say, if you need to do other stuff concurrently, run that other stuff in the thread, and leave this bit to run in main.
In reply to Re: SSH by thread
by BrowserUk
in thread SSH by thread
by hxbsy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |