Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>3.3.2 Connection objects </title> |
| 5 | <META NAME="description" CONTENT="3.3.2 Connection objects "> |
| 6 | <META NAME="keywords" CONTENT="pyOpenSSL"> |
| 7 | <META NAME="resource-type" CONTENT="document"> |
| 8 | <META NAME="distribution" CONTENT="global"> |
| 9 | <link rel="STYLESHEET" href="pyOpenSSL.css"> |
| 10 | <LINK REL="previous" href="openssl-context.html"> |
| 11 | <LINK REL="up" href="openssl-ssl.html"> |
| 12 | <LINK REL="next" href="internals.html"> |
| 13 | </head> |
| 14 | <body> |
| 15 | <DIV CLASS="navigation"> |
| 16 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 17 | <tr> |
| 18 | <td><A href="openssl-context.html"><img src="previous.gif" |
| 19 | border="0" height="32" |
| 20 | alt="Previous Page" width="32"></A></td> |
| 21 | <td><A href="openssl-ssl.html"><img src="up.gif" |
| 22 | border="0" height="32" |
| 23 | alt="Up One Level" width="32"></A></td> |
| 24 | <td><A href="internals.html"><img src="next.gif" |
| 25 | border="0" height="32" |
| 26 | alt="Next Page" width="32"></A></td> |
| 27 | <td align="center" width="100%">Python OpenSSL Manual</td> |
| 28 | <td><A href="contents.html"><img src="contents.gif" |
| 29 | border="0" height="32" |
| 30 | alt="Contents" width="32"></A></td> |
| 31 | <td><img src="blank.gif" |
| 32 | border="0" height="32" |
| 33 | alt="" width="32"></td> |
| 34 | <td><img src="blank.gif" |
| 35 | border="0" height="32" |
| 36 | alt="" width="32"></td> |
| 37 | </tr></table> |
| 38 | <b class="navlabel">Previous:</b> <a class="sectref" href="openssl-context.html">3.3.1 Context objects</A> |
| 39 | <b class="navlabel">Up:</b> <a class="sectref" href="openssl-ssl.html">3.3 SSL </A> |
| 40 | <b class="navlabel">Next:</b> <a class="sectref" href="internals.html">4 Internals</A> |
| 41 | <br><hr> |
| 42 | </DIV> |
| 43 | <!--End of Navigation Panel--> |
| 44 | |
| 45 | <H3><A NAME="SECTION000432000000000000000"> </A> |
| 46 | <BR> |
| 47 | 3.3.2 Connection objects |
| 48 | </H3> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 49 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 50 | <P> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 51 | Connection objects have the following methods: |
| 52 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 53 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 54 | <dl><dt><b><a name='l2h-145'><tt class='method'>accept</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 55 | <dd> |
| 56 | Call the <tt class="method">accept</tt> method of the underlying socket and set up SSL on the |
| 57 | returned socket, using the Context object supplied to this Connection object at |
| 58 | creation. Returns a pair <code>(<var>conn</var>, <var>address</var>)</code>. where <var>conn</var> |
| 59 | is the new Connection object created, and <var>address</var> is as returned by the |
| 60 | socket's <tt class="method">accept</tt>. |
| 61 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 62 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 63 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 64 | <dl><dt><b><a name='l2h-146'><tt class='method'>bind</tt></a></b>(<var>address</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 65 | <dd> |
| 66 | Call the <tt class="method">bind</tt> method of the underlying socket. |
| 67 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 68 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 69 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 70 | <dl><dt><b><a name='l2h-147'><tt class='method'>close</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 71 | <dd> |
| 72 | Call the <tt class="method">close</tt> method of the underlying socket. Note: If you want |
| 73 | correct SSL closure, you need to call the <tt class="method">shutdown</tt> method first. |
| 74 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 75 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 76 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 77 | <dl><dt><b><a name='l2h-148'><tt class='method'>connect</tt></a></b>(<var>address</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 78 | <dd> |
| 79 | Call the <tt class="method">connect</tt> method of the underlying socket and set up SSL on the |
| 80 | socket, using the Context object supplied to this Connection object at |
| 81 | creation. |
| 82 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 83 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 84 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 85 | <dl><dt><b><a name='l2h-149'><tt class='method'>connect_ex</tt></a></b>(<var>address</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 86 | <dd> |
| 87 | Call the <tt class="method">connect_ex</tt> method of the underlying socket and set up SSL on |
| 88 | the socket, using the Context object supplied to this Connection object at |
| 89 | creation. Note that if the <tt class="method">connect_ex</tt> method of the socket doesn't |
| 90 | return 0, SSL won't be initialized. |
| 91 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 92 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 93 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 94 | <dl><dt><b><a name='l2h-150'><tt class='method'>do_handshake</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 95 | <dd> |
| 96 | Perform an SSL handshake (usually called after <tt class="method">renegotiate</tt> or one of |
| 97 | <tt class="method">set_accept_state</tt> or <tt class="method">set_accept_state</tt>). This can raise the |
| 98 | same exceptions as <tt class="method">send</tt> and <tt class="method">recv</tt>. |
| 99 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 100 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 101 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 102 | <dl><dt><b><a name='l2h-151'><tt class='method'>fileno</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 103 | <dd> |
| 104 | Retrieve the file descriptor number for the underlying socket. |
| 105 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 106 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 107 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 108 | <dl><dt><b><a name='l2h-152'><tt class='method'>listen</tt></a></b>(<var>backlog</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 109 | <dd> |
| 110 | Call the <tt class="method">listen</tt> method of the underlying socket. |
| 111 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 112 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 113 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 114 | <dl><dt><b><a name='l2h-153'><tt class='method'>get_app_data</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 115 | <dd> |
| 116 | Retrieve application data as set by <tt class="method">set_app_data</tt>. |
| 117 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 118 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 119 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 120 | <dl><dt><b><a name='l2h-154'><tt class='method'>get_cipher_list</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 121 | <dd> |
| 122 | Retrieve the list of ciphers used by the Connection object. WARNING: This API |
| 123 | has changed. It used to take an optional parameter and just return a string, |
| 124 | but not it returns the entire list in one go. |
| 125 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 126 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 127 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 128 | <dl><dt><b><a name='l2h-155'><tt class='method'>get_context</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 129 | <dd> |
| 130 | Retrieve the Context object associated with this Connection. |
| 131 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 132 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 133 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 134 | <dl><dt><b><a name='l2h-156'><tt class='method'>get_peer_certificate</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 135 | <dd> |
| 136 | Retrieve the other side's certificate (if any) |
| 137 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 138 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 139 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 140 | <dl><dt><b><a name='l2h-157'><tt class='method'>getpeername</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 141 | <dd> |
| 142 | Call the <tt class="method">getpeername</tt> method of the underlying socket. |
| 143 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 144 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 145 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 146 | <dl><dt><b><a name='l2h-158'><tt class='method'>getsockname</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 147 | <dd> |
| 148 | Call the <tt class="method">getsockname</tt> method of the underlying socket. |
| 149 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 150 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 151 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 152 | <dl><dt><b><a name='l2h-159'><tt class='method'>getsockopt</tt></a></b>(<var>level, optname</var><big>[</big><var>, buflen</var><big>]</big>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 153 | <dd> |
| 154 | Call the <tt class="method">getsockopt</tt> method of the underlying socket. |
| 155 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 156 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 157 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 158 | <dl><dt><b><a name='l2h-160'><tt class='method'>pending</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 159 | <dd> |
Jean-Paul Calderone | b6f57be | 2008-03-06 21:22:16 -0500 | [diff] [blame] | 160 | Retrieve the number of bytes that can be safely read from the SSL buffer |
| 161 | (<i>not</i> the underlying transport buffer). |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 162 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 163 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 164 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 165 | <dl><dt><b><a name='l2h-161'><tt class='method'>recv</tt></a></b>(<var>bufsize</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 166 | <dd> |
| 167 | Receive data from the Connection. The return value is a string representing the |
| 168 | data received. The maximum amount of data to be received at once, is specified |
| 169 | by <var>bufsize</var>. |
| 170 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 171 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 172 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 173 | <dl><dt><b><a name='l2h-162'><tt class='method'>renegotiate</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 174 | <dd> |
| 175 | Renegotiate the SSL session. Call this if you wish to change cipher suites or |
| 176 | anything like that. |
| 177 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 178 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 179 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 180 | <dl><dt><b><a name='l2h-163'><tt class='method'>send</tt></a></b>(<var>string</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 181 | <dd> |
| 182 | Send the <var>string</var> data to the Connection. |
| 183 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 184 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 185 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 186 | <dl><dt><b><a name='l2h-164'><tt class='method'>sendall</tt></a></b>(<var>string</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 187 | <dd> |
| 188 | Send all of the <var>string</var> data to the Connection. This calls <tt class="method">send</tt> |
| 189 | repeatedly until all data is sent. If an error occurs, it's impossible to tell |
| 190 | how much data has been sent. |
| 191 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 192 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 193 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 194 | <dl><dt><b><a name='l2h-165'><tt class='method'>set_accept_state</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 195 | <dd> |
| 196 | Set the connection to work in server mode. The handshake will be handled |
| 197 | automatically by read/write. |
| 198 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 199 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 200 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 201 | <dl><dt><b><a name='l2h-166'><tt class='method'>set_app_data</tt></a></b>(<var>data</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 202 | <dd> |
| 203 | Associate <var>data</var> with this Connection object. <var>data</var> can be retrieved |
| 204 | later using the <tt class="method">get_app_data</tt> method. |
| 205 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 206 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 207 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 208 | <dl><dt><b><a name='l2h-167'><tt class='method'>set_connect_state</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 209 | <dd> |
| 210 | Set the connection to work in client mode. The handshake will be handled |
| 211 | automatically by read/write. |
| 212 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 213 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 214 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 215 | <dl><dt><b><a name='l2h-168'><tt class='method'>setblocking</tt></a></b>(<var>flag</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 216 | <dd> |
| 217 | Call the <tt class="method">setblocking</tt> method of the underlying socket. |
| 218 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 219 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 220 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 221 | <dl><dt><b><a name='l2h-169'><tt class='method'>setsockopt</tt></a></b>(<var>level, optname, value</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 222 | <dd> |
| 223 | Call the <tt class="method">setsockopt</tt> method of the underlying socket. |
| 224 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 225 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 226 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 227 | <dl><dt><b><a name='l2h-170'><tt class='method'>shutdown</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 228 | <dd> |
| 229 | Send the shutdown message to the Connection. Returns true if the shutdown |
| 230 | message exchange is completed and false otherwise (in which case you call |
| 231 | <tt class="method">recv()</tt> or <tt class="method">send()</tt> when the connection becomes |
| 232 | readable/writeable. |
| 233 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 234 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 235 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 236 | <dl><dt><b><a name='l2h-171'><tt class='method'>get_shutdown</tt></a></b>() |
Jean-Paul Calderone | 72b8f0f | 2008-02-21 23:57:40 -0500 | [diff] [blame] | 237 | <dd> |
| 238 | Get the shutdown state of the Connection. Returns a bitvector of either or |
| 239 | both of <var>SENT_SHUTDOWN</var> and <var>RECEIVED_SHUTDOWN</var>. |
| 240 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 241 | |
Jean-Paul Calderone | 72b8f0f | 2008-02-21 23:57:40 -0500 | [diff] [blame] | 242 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 243 | <dl><dt><b><a name='l2h-172'><tt class='method'>set_shutdown</tt></a></b>(<var>state</var>) |
Jean-Paul Calderone | 72b8f0f | 2008-02-21 23:57:40 -0500 | [diff] [blame] | 244 | <dd> |
| 245 | Set the shutdown state of the Connection. <var>state</var> is a bitvector of |
| 246 | either or both of <var>SENT_SHUTDOWN</var> and <var>RECEIVED_SHUTDOWN</var>. |
| 247 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 248 | |
Jean-Paul Calderone | 72b8f0f | 2008-02-21 23:57:40 -0500 | [diff] [blame] | 249 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 250 | <dl><dt><b><a name='l2h-173'><tt class='method'>sock_shutdown</tt></a></b>(<var>how</var>) |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 251 | <dd> |
| 252 | Call the <tt class="method">shutdown</tt> method of the underlying socket. |
| 253 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 254 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 255 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 256 | <dl><dt><b><a name='l2h-174'><tt class='method'>state_string</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 257 | <dd> |
| 258 | Retrieve a verbose string detailing the state of the Connection. |
| 259 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 260 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 261 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 262 | <dl><dt><b><a name='l2h-175'><tt class='method'>want_read</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 263 | <dd> |
| 264 | Checks if more data has to be read from the transport layer to complete an |
| 265 | operation. |
| 266 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 267 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 268 | <P> |
Jean-Paul Calderone | c54cc18 | 2008-03-26 21:11:07 -0400 | [diff] [blame^] | 269 | <dl><dt><b><a name='l2h-176'><tt class='method'>want_write</tt></a></b>() |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 270 | <dd> |
| 271 | Checks if there is data to write to the transport layer to complete an |
| 272 | operation. |
| 273 | </dl> |
Jean-Paul Calderone | 2aa2b33 | 2008-03-06 21:43:14 -0500 | [diff] [blame] | 274 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 275 | <P> |
| 276 | |
| 277 | <DIV CLASS="navigation"> |
| 278 | <p><hr> |
| 279 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 280 | <tr> |
| 281 | <td><A href="openssl-context.html"><img src="previous.gif" |
| 282 | border="0" height="32" |
| 283 | alt="Previous Page" width="32"></A></td> |
| 284 | <td><A href="openssl-ssl.html"><img src="up.gif" |
| 285 | border="0" height="32" |
| 286 | alt="Up One Level" width="32"></A></td> |
| 287 | <td><A href="internals.html"><img src="next.gif" |
| 288 | border="0" height="32" |
| 289 | alt="Next Page" width="32"></A></td> |
| 290 | <td align="center" width="100%">Python OpenSSL Manual</td> |
| 291 | <td><A href="contents.html"><img src="contents.gif" |
| 292 | border="0" height="32" |
| 293 | alt="Contents" width="32"></A></td> |
| 294 | <td><img src="blank.gif" |
| 295 | border="0" height="32" |
| 296 | alt="" width="32"></td> |
| 297 | <td><img src="blank.gif" |
| 298 | border="0" height="32" |
| 299 | alt="" width="32"></td> |
| 300 | </tr></table> |
| 301 | <b class="navlabel">Previous:</b> <a class="sectref" href="openssl-context.html">3.3.1 Context objects</A> |
| 302 | <b class="navlabel">Up:</b> <a class="sectref" href="openssl-ssl.html">3.3 SSL </A> |
| 303 | <b class="navlabel">Next:</b> <a class="sectref" href="internals.html">4 Internals</A> |
| 304 | <hr> |
Jean-Paul Calderone | d2532d8 | 2008-03-25 15:20:39 -0400 | [diff] [blame] | 305 | <span class="release-info">Release 0.7a2.</span> |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 306 | </DIV> |
| 307 | <!--End of Navigation Panel--> |
| 308 | |
| 309 | </BODY> |
| 310 | </HTML> |