[Top][All Lists]

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

Re: Calling 'select' from emacs_gnutls_pull

From: Ted Zlatanov
Subject: Re: Calling 'select' from emacs_gnutls_pull
Date: Sat, 16 Feb 2013 13:00:58 -0500
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

On Sat, 16 Feb 2013 18:52:23 +0200 Eli Zaretskii <address@hidden> wrote: 

>> From: Ted Zlatanov <address@hidden>
>> Date: Sat, 16 Feb 2013 10:55:45 -0500

>> So I don't know if it would make sense to let the Emacs
>> reader thread handle the socket management, because we could end up with
>> poor performance or even contention.

EZ> We already use the Emacs reader threads for that.  And it works well
EZ> enough for sockets.  In a nutshell, the reader thread does blocking
EZ> reads from the socket, while 'sys_read' (called by Emacs as 'read')
EZ> emulates non-blocking reads, by looking at the status set by the
EZ> reader thread.

Nice.  The simpler, the better!

>> if I can help simulate this condition or test some possible
>> solutions, I'll be glad to assist.

EZ> Thanks.  It would be good if you (or someone else) could describe a
EZ> simple setup for reading stuff via GnuTLS from some URL, which I could
EZ> then try on my machine under a debugger.

Sure.  It's actually quite simple to open a SSL connection to the HTTP/S
port (the SERVICE parameter is either a string or an integer):

#+begin_src lisp
(open-gnutls-stream "tls" "tls-buffer" "yourserver.com" "https")

If GnuTLS support is enabled, opening any SSL connection with the
`url-*' function should do it too... it's the default transport.

You can also call `gnutls-negotiate' directly, see `gnutls.el' for the


reply via email to

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