[gnutls-devel] [PATCH 1/2] guile: doc: Explain "Application Data" packets and 'session-record-port'.
Ludovic Courtès
ludo at gnu.org
Mon Mar 14 10:44:07 CET 2016
* doc/gnutls-guile.texi (Input and Output): Mention "Application Data"
packets and buffering.
---
doc/gnutls-guile.texi | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/doc/gnutls-guile.texi b/doc/gnutls-guile.texi
index 061a31f..8a085be 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
+ at c See <http://bugs.gnu.org/22966> for details.
+ at 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!
--
2.6.3
More information about the Gnutls-devel
mailing list