1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module gdata.tlslite.integration.AsyncStateMachine</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="gdata.html"><font color="#ffffff">gdata</font></a>.<a href="gdata.tlslite.html"><font color="#ffffff">tlslite</font></a>.<a href="gdata.tlslite.integration.html"><font color="#ffffff">integration</font></a>.AsyncStateMachine</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/afshar/wrk/gdata-python-client/src/gdata/tlslite/integration/AsyncStateMachine.py">/home/afshar/wrk/gdata-python-client/src/gdata/tlslite/integration/AsyncStateMachine.py</a></font></td></tr></table>
<p><tt>A state machine for using TLS Lite with asynchronous I/O.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="gdata.tlslite.integration.AsyncStateMachine.html#AsyncStateMachine">AsyncStateMachine</a>
</font></dt></dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="AsyncStateMachine">class <strong>AsyncStateMachine</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This is an abstract class that's used to integrate TLS Lite with<br>
asyncore and Twisted.<br>
<br>
This class signals wantsReadsEvent() and <a href="#AsyncStateMachine-wantsWriteEvent">wantsWriteEvent</a>(). When<br>
the underlying socket has become readable or writeable, the event<br>
should be passed to this class by calling <a href="#AsyncStateMachine-inReadEvent">inReadEvent</a>() or<br>
<a href="#AsyncStateMachine-inWriteEvent">inWriteEvent</a>(). This class will then try to read or write through<br>
the socket, and will update its state appropriately.<br>
<br>
This class will forward higher-level events to its subclass. For<br>
example, when a complete TLS record has been received,<br>
<a href="#AsyncStateMachine-outReadEvent">outReadEvent</a>() will be called with the decrypted data.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="AsyncStateMachine-__init__"><strong>__init__</strong></a>(self)</dt></dl>
<dl><dt><a name="AsyncStateMachine-inReadEvent"><strong>inReadEvent</strong></a>(self)</dt><dd><tt>Tell the state machine it can read from the socket.</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-inWriteEvent"><strong>inWriteEvent</strong></a>(self)</dt><dd><tt>Tell the state machine it can write to the socket.</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-outCloseEvent"><strong>outCloseEvent</strong></a>(self)</dt><dd><tt>Called when a close operation completes.<br>
<br>
May be overridden in subclass.</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-outConnectEvent"><strong>outConnectEvent</strong></a>(self)</dt><dd><tt>Called when a handshake operation completes.<br>
<br>
May be overridden in subclass.</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-outReadEvent"><strong>outReadEvent</strong></a>(self, readBuffer)</dt><dd><tt>Called when a read operation completes.<br>
<br>
May be overridden in subclass.</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-outWriteEvent"><strong>outWriteEvent</strong></a>(self)</dt><dd><tt>Called when a write operation completes.<br>
<br>
May be overridden in subclass.</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-setCloseOp"><strong>setCloseOp</strong></a>(self)</dt><dd><tt>Start a close operation.</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-setHandshakeOp"><strong>setHandshakeOp</strong></a>(self, handshaker)</dt><dd><tt>Start a handshake operation.<br>
<br>
@type handshaker: generator<br>
@param handshaker: A generator created by using one of the<br>
asynchronous handshake functions (i.e. handshakeServerAsync, or<br>
handshakeClientxxx(..., async=True).</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-setServerHandshakeOp"><strong>setServerHandshakeOp</strong></a>(self, **args)</dt><dd><tt>Start a handshake operation.<br>
<br>
The arguments passed to this function will be forwarded to<br>
L{tlslite.TLSConnection.TLSConnection.handshakeServerAsync}.</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-setWriteOp"><strong>setWriteOp</strong></a>(self, writeBuffer)</dt><dd><tt>Start a write operation.<br>
<br>
@type writeBuffer: str<br>
@param writeBuffer: The string to transmit.</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-wantsReadEvent"><strong>wantsReadEvent</strong></a>(self)</dt><dd><tt>If the state machine wants to read.<br>
<br>
If an operation is active, this returns whether or not the<br>
operation wants to read from the socket. If an operation is<br>
not active, this returns None.<br>
<br>
@rtype: bool or None<br>
@return: If the state machine wants to read.</tt></dd></dl>
<dl><dt><a name="AsyncStateMachine-wantsWriteEvent"><strong>wantsWriteEvent</strong></a>(self)</dt><dd><tt>If the state machine wants to write.<br>
<br>
If an operation is active, this returns whether or not the<br>
operation wants to write to the socket. If an operation is<br>
not active, this returns None.<br>
<br>
@rtype: bool or None<br>
@return: If the state machine wants to write.</tt></dd></dl>
</td></tr></table></td></tr></table>
</body></html>
|