Subject: [libssh2] polling isn't working on linux

[libssh2] polling isn't working on linux

From: Paul Thomas <>
Date: Fri, 25 Jan 2008 23:13:13 -0500

Developers....I'm having library problems again, heres my problem.

The same code that I have works quite well on windows. But running
this same code on linux randomly returns 0 when their is in fact data
on the socket. I'm using Qt4 and am using the QSocketNotifier class to
tell me when there is data on the socket available. Then when theres
data, I use the libssh2 library polling to try and see which channel
has data. The socket is being created natively with each OS's
respective socket creation method. I based my socket creation code off
of your /libssh2/example/simple/ssh2.c code. The problem that I'm
having is that the two main polling methods

pfd.type = LIBSSH2_POLLFD_CHANNEL; = (*mp_channelList)[i]->pChannel; //pointer to a valid channel
                int result = libssh2_poll( &pfd, 1, 1);
                printf("Polling result: %d\n", result);
                result = libssh2_poll_channel_read((*mp_channelList)[i]->pChannel, 0);
                printf("Polling result: %d\n", result);
                result = libssh2_poll_channel_read((*mp_channelList)[i]->pChannel, 1);
                printf("Polling result: %d\n", result);

Now from the code above, I'm trying 3 different polling calls. And
each time I run my app, the polling functions are randomly working and
not working. Here's the results of me running a few connection tests:

Polling result: 1
Polling result: 1
Polling result: 0
-----------Next run --------------
Polling result: 0
Polling result: 1
Polling result: 0
-----------Next run --------------
Polling result: 1
Polling result: 1
Polling result: 0

The 3rd method doesn't ever seem to work. I'm really lost as to why
its randomly crapping out like this.

Any ideas?

This email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
libssh2-devel mailing list
Received on 2008-01-26