gnutls-devel
[Top][All Lists]
Advanced

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

Re: select + record_recv


From: Sam Varshavchik
Subject: Re: select + record_recv
Date: Sat, 10 Jul 2010 16:53:18 -0400

Nikos Mavrogiannopoulos writes:

In the early versions of GnuTLS I implemented a hack in order to use
select() to check whether there are data to read from the gnutls
session. Is this feature actually used? If you want to check for data in
a gnutls_session how do you do it?

I always thought that the correct logic is:

1) Non-blocking sockets are a must.

2) Check what gnutls_record_check_pending() tells you, first.

23 If there's nothing pending, poll() or select(), and if it indicates that data is available, try gnutls_record_recv().

Now, if gnutls_record_recv() hands you back some data, you do have to consume it. However, this logic seems to work reliably for me, in event-driven situations.

Attachment: pgpcLSBqPn5Cx.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]