Tizen 2.0 Release
[external/libgnutls26.git] / doc / manpages / gnutls_bye.3
1 .\" DO NOT MODIFY THIS FILE!  It was generated by gdoc.
2 .TH "gnutls_bye" 3 "2.12.6.1" "gnutls" "gnutls"
3 .SH NAME
4 gnutls_bye \- API function
5 .SH SYNOPSIS
6 .B #include <gnutls/gnutls.h>
7 .sp
8 .BI "int gnutls_bye(gnutls_session_t " session ", gnutls_close_request_t " how ");"
9 .SH ARGUMENTS
10 .IP "gnutls_session_t session" 12
11 is a \fBgnutls_session_t\fP structure.
12 .IP "gnutls_close_request_t how" 12
13 is an integer
14 .SH "DESCRIPTION"
15 Terminates the current TLS/SSL connection. The connection should
16 have been initiated using \fBgnutls_handshake()\fP.  \fIhow\fP should be one
17 of \fBGNUTLS_SHUT_RDWR\fP, \fBGNUTLS_SHUT_WR\fP.
18
19 In case of \fBGNUTLS_SHUT_RDWR\fP then the TLS connection gets
20 terminated and further receives and sends will be disallowed.  If
21 the return value is zero you may continue using the connection.
22 \fBGNUTLS_SHUT_RDWR\fP actually sends an alert containing a close
23 request and waits for the peer to reply with the same message.
24
25 In case of \fBGNUTLS_SHUT_WR\fP then the TLS connection gets terminated
26 and further sends will be disallowed. In order to reuse the
27 connection you should wait for an EOF from the peer.
28 \fBGNUTLS_SHUT_WR\fP sends an alert containing a close request.
29
30 Note that not all implementations will properly terminate a TLS
31 connection.  Some of them, usually for performance reasons, will
32 terminate only the underlying transport layer, thus causing a
33 transmission error to the peer.  This error cannot be
34 distinguished from a malicious party prematurely terminating the
35 session, thus this behavior is not recommended.
36
37 This function may also return \fBGNUTLS_E_AGAIN\fP or
38 \fBGNUTLS_E_INTERRUPTED\fP; cf.  \fBgnutls_record_get_direction()\fP.
39 .SH "RETURNS"
40 \fBGNUTLS_E_SUCCESS\fP on success, or an error code, see
41 function documentation for entire semantics.
42 .SH "REPORTING BUGS"
43 Report bugs to <bug-gnutls@gnu.org>.
44 GnuTLS home page: http://www.gnu.org/software/gnutls/
45 General help using GNU software: http://www.gnu.org/gethelp/
46 .SH COPYRIGHT
47 Copyright \(co 2008 Free Software Foundation.
48 .br
49 Copying and distribution of this file, with or without modification,
50 are permitted in any medium without royalty provided the copyright
51 notice and this notice are preserved.
52 .SH "SEE ALSO"
53 The full documentation for
54 .B gnutls
55 is maintained as a Texinfo manual.  If the
56 .B info
57 and
58 .B gnutls
59 programs are properly installed at your site, the command
60 .IP
61 .B info gnutls
62 .PP
63 should give you access to the complete manual.