[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: return value of gnutls_record_check_pending
From: |
Nikos Mavrogiannopoulos |
Subject: |
Re: return value of gnutls_record_check_pending |
Date: |
Tue, 28 Jun 2011 23:35:08 +0300 |
On Tue, Jun 28, 2011 at 7:59 PM, Michael Cronenworth <address@hidden> wrote:
> Hi all,
>
> My understanding of the man page for the function
> gnutls_record_check_pending() says that it should return the number of bytes
> waiting to be read, or 0 bytes if nothing is to be read.
The description of the function mentions "in the gnutls buffers". I believe this
clarifies the discrepancy you see in the example below. select()
checks the kernel
buffers.
regards,
Nikos
> example pseudo-code:
> while( 1 ) {
> ret = select( fd );
> // ret == 1
> ret = gnutls_record_check_pending( session );
> // ret == 0
> if ( ret == 0 )
> continue;
> gnutls_record_recv( session );
> }
>