Subject: libssh2_init()


From: Vishal Sharma <>
Date: Mon, 6 Oct 2014 16:39:20 -0500



I have a question about libssh2_init() function.

I am using libssh2 library in a multi-thread application. There are several
threads that use sftp and ssh functions to communicated with a remote

My question is - Do I call "rc = libssh2_init (0);" within each thread that
would be performing either read/write via sftp or execute a command on
remote server via ssh? Or should there be a master thread which would call
"rc = libssh2_init (0);" to initialize crypto library in a global context
for the entire application?


Please let me know.


Thank you,


Vishal Sharma

Received on 2014-10-06