summaryrefslogtreecommitdiff
path: root/doc/gnutls-guile.texi
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-03-14 10:44:07 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-03-15 11:50:39 +0100
commit0b1c136947878ccb600b4fa785ef257909104144 (patch)
treea8abae39fbea7620334aa654d3f2da10cb38861e /doc/gnutls-guile.texi
parentf851b6870903b9ce451f9e978dd37f0692bf32dd (diff)
downloadgnutls-0b1c136947878ccb600b4fa785ef257909104144.tar.gz
guile: doc: Explain "Application Data" packets and 'session-record-port'.
* doc/gnutls-guile.texi (Input and Output): Mention "Application Data" packets and buffering.
Diffstat (limited to 'doc/gnutls-guile.texi')
-rw-r--r--doc/gnutls-guile.texi16
1 files changed, 13 insertions, 3 deletions
diff --git a/doc/gnutls-guile.texi b/doc/gnutls-guile.texi
index 061a31f90c..8a085be435 100644
--- a/doc/gnutls-guile.texi
+++ b/doc/gnutls-guile.texi
@@ -359,18 +359,28 @@ Once a TLS session is established, data can be communicated through it
;;
;; Initialize the various parameters of SESSION, set up
- ;; a network connection, etc...
+ ;; a network connection, etc.
;;
(let ((i/o (session-record-port session)))
- (write "Hello peer!" i/o)
+ (display "Hello peer!" i/o)
(let ((greetings (read i/o)))
- ;; ...
+ ;; @dots{}
(bye session close-request/rdwr))))
@end example
+@c See <http://bugs.gnu.org/22966> for details.
+@cindex buffering
+Note that each write to the session record port leads to the
+transmission of an encrypted TLS ``Application Data'' packet. In the
+above example, we create an Application Data packet for the 11 bytes for
+the string that we write. This is not efficient both in terms of CPU
+usage and bandwidth (each packet adds at least 5 bytes of overhead and
+can lead to one @code{write} system call), so we recommend that
+applications do their own buffering.
+
@findex record-send
@findex record-receive!