libssh2 and simultaneous connections
Posted
by
Florian Margaine
on Programmers
See other posts from Programmers
or by Florian Margaine
Published on 2012-09-08T21:35:02Z
Indexed on
2012/09/08
21:48 UTC
Read the original article
Hit count: 455
I'm writing a node.js C++ module using the C library libssh2. The module is supposed to be a bridge to connect to SSH over HTTPS.
Right now, I'm still in the design/learning phase of v8 API and C++, and I have a design question:
libssh2 is a C library, all its methods are global. From what I see in the examples, libssh2 can only handle one connection at a time.
If I want to allow simultaneous connections to different SSH servers, do I have to fork a process to completely separate the libssh2 "instances", or is forking a thread enough? I don't know enough of the separation limit used there.
Any idea on how to handle this is appreciated.
© Programmers or respective owner