Problems with async read on a tls session

Nicolas Mora <[email protected]>
Newsgroups gmane.network.gnutls.general
Message-ID <[email protected]>
Hello,

I'm implementing a websocket client library over https, so I need to run
asynchronous read on the gnutls session to be able to send messages
while I'm receiving them.

I'm having trouble detecting if the socket has incoming activity,
gnutls_record_check_pending, it always return 0.

I'm based on the "Client example with X.509 certificate support" to make
my http connection, so the tcp socket is basically initiated like that
(pseudo-code):

tcp_sock = socket(AF_INET, SOCK_STREAM, 0);
connect(tcp_sock, (struct sockaddr *)&server , sizeof(server));
gnutls_transport_set_int(gnutls_session, tcp_sock);
gnutls_handshake_set_timeout(gnutls_session,
GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);

What do I miss to have a working async connection?

Thanks in advance

/Nicolas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.