Hello!
I try to create a multithreaded ssh server.
Main thread creates new session and accepts a connection. After acception
each session will be processed in separate thread.
...
while (1)
{
ssh_session session = ssh_new();
if (session == NULL)
{
fprintf(stderr, "Failed to allocate session\n");
continue;
}
/* Blocks until there is a new incoming connection. */
if (ssh_bind_accept(m_sshbind, session) != SSH_ERROR)
{
// start a new thread with session
// ...
}
}
In a session's thread new event is created and event loop is started.
Session is used only in its own thread (I hope so).
I'm using my own thread classes.
Do I need to call ssh_threads_set_callbacks with my own implementation of
callbacks? If so what should do thread_id function?