[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem in ssh_connect()


Hello,

I have a problem when I try to connect to a server with ssh_connect()

I use libSSH 0.4.7-1 on Windows XP, with Visual C++ 6.0 (binaries from http://winkde.org/pub/kde/ports/win32/releases/stable/latest/)

The program tries to connect successively to different servers.

On the most servers, the connection and all the tasks using libSSH work well

But with some servers, the function ssh_connect() blocks indefinitely the program, even if I set the option SSH_OPTIONS_TIMEOUT to 5 seconds.


The code for the connection is:

if(m_bIsConnected)
                return false;

        int port = 22, rHost, rPort, rTimeout;

        rHost = ssh_options_set(m_session, SSH_OPTIONS_HOST, host);
        rPort = ssh_options_set(m_session, SSH_OPTIONS_PORT, &port);
        rTimeout = ssh_options_set(m_session, SSH_OPTIONS_TIMEOUT, &timeout);

        if( (rHost + rPort + rTimeout) != 0)
                return false;

        if (ssh_connect(m_session) != SSH_OK)
                return false;

        m_bIsConnected = true;
        return true;



Is there a solution to this problem?

Regards


Archive administrator: postmaster@lists.cynapses.org