--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Cooperation.Connection.html Sun Mar 21 19:34:15 2010 +0000 @@ -0,0 +1,271 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' +'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> +<html><head> +<title>eric5.Cooperation.Connection</title> +<style> +body { + background:white; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #4FA4FF; } +h2 { color: white; background: #4FA4FF; } +h3 { color: white; background: #00557F; } +h4 { color: white; background: #00557F; } + +a { color: #AA5500; } + +</style> +</head> +<body><a NAME="top" ID="top"></a> +<h1>eric5.Cooperation.Connection</h1> +<p> +Module implementing a class representing a peer connection. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>MaxBufferSize</td></tr><tr><td>PingInterval</td></tr><tr><td>PongTimeout</td></tr><tr><td>SeparatorToken</td></tr><tr><td>TransferTimeout</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#Connection">Connection</a></td> +<td>Class representing a peer connection.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> +<hr /><hr /> +<a NAME="Connection" ID="Connection"></a> +<h2>Connection</h2> +<p> + Class representing a peer connection. +</p><h4>Signals</h4> +<dl> +<dt>getParticipants()</dt> +<dd> +emitted after a get participants message has arrived +</dd><dt>newMessage(user, message)</dt> +<dd> +emitted after a new message has + arrived (string, string) +</dd><dt>participants(participants)</dt> +<dd> +emitted after the list of participants has + arrived (list of strings of "host:port") +</dd><dt>readyForUse()</dt> +<dd> +emitted when the connection is ready for use +</dd> +</dl> +<h3>Derived from</h3> +QTcpSocket +<h3>Class Attributes</h3> +<table> +<tr><td>GetParticipants</td></tr><tr><td>Greeting</td></tr><tr><td>Participants</td></tr><tr><td>Ping</td></tr><tr><td>PlainText</td></tr><tr><td>Pong</td></tr><tr><td>ProtocolGetParticipants</td></tr><tr><td>ProtocolGreeting</td></tr><tr><td>ProtocolMessage</td></tr><tr><td>ProtocolParticipants</td></tr><tr><td>ProtocolPing</td></tr><tr><td>ProtocolPong</td></tr><tr><td>ReadingGreeting</td></tr><tr><td>ReadyForUse</td></tr><tr><td>Undefined</td></tr><tr><td>WaitingForGreeting</td></tr><tr><td>getParticipants</td></tr><tr><td>newMessage</td></tr><tr><td>participants</td></tr><tr><td>readyForUse</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#Connection.__init__">Connection</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#Connection.__dataLengthForCurrentDataType">__dataLengthForCurrentDataType</a></td> +<td>Private method to get the data length for the current data type.</td> +</tr><tr> +<td><a href="#Connection.__hasEnoughData">__hasEnoughData</a></td> +<td>Private method to check, if enough data is available.</td> +</tr><tr> +<td><a href="#Connection.__processData">__processData</a></td> +<td>Private method to process the received data.</td> +</tr><tr> +<td><a href="#Connection.__processReadyRead">__processReadyRead</a></td> +<td>Private slot to handle the readyRead signal.</td> +</tr><tr> +<td><a href="#Connection.__readDataIntoBuffer">__readDataIntoBuffer</a></td> +<td>Private method to read some data into the buffer.</td> +</tr><tr> +<td><a href="#Connection.__readProtocolHeader">__readProtocolHeader</a></td> +<td>Private method to read the protocol header.</td> +</tr><tr> +<td><a href="#Connection.__sendGreetingMessage">__sendGreetingMessage</a></td> +<td>Private slot to send a greeting message.</td> +</tr><tr> +<td><a href="#Connection.__sendPing">__sendPing</a></td> +<td>Private slot to send a ping message.</td> +</tr><tr> +<td><a href="#Connection.name">name</a></td> +<td>Public method to get the connection name.</td> +</tr><tr> +<td><a href="#Connection.sendGetParticipants">sendGetParticipants</a></td> +<td>Public method to request a list of participants.</td> +</tr><tr> +<td><a href="#Connection.sendMessage">sendMessage</a></td> +<td>Public method to send a message.</td> +</tr><tr> +<td><a href="#Connection.sendParticipants">sendParticipants</a></td> +<td>Public method to send the list of participants.</td> +</tr><tr> +<td><a href="#Connection.serverPort">serverPort</a></td> +<td>Public method to get the server port.</td> +</tr><tr> +<td><a href="#Connection.setGreetingMessage">setGreetingMessage</a></td> +<td>Public method to set the greeting message.</td> +</tr><tr> +<td><a href="#Connection.timerEvent">timerEvent</a></td> +<td>Protected method to handle timer events.</td> +</tr> +</table> +<a NAME="Connection.__init__" ID="Connection.__init__"></a> +<h4>Connection (Constructor)</h4> +<b>Connection</b>(<i>parent = None</i>) +<p> + Constructor +</p><dl> +<dt><i>parent</i></dt> +<dd> +referenec to the parent object (QObject) +</dd> +</dl><a NAME="Connection.__dataLengthForCurrentDataType" ID="Connection.__dataLengthForCurrentDataType"></a> +<h4>Connection.__dataLengthForCurrentDataType</h4> +<b>__dataLengthForCurrentDataType</b>(<i></i>) +<p> + Private method to get the data length for the current data type. +</p><dl> +<dt>Returns:</dt> +<dd> +data length (integer) +</dd> +</dl><a NAME="Connection.__hasEnoughData" ID="Connection.__hasEnoughData"></a> +<h4>Connection.__hasEnoughData</h4> +<b>__hasEnoughData</b>(<i></i>) +<p> + Private method to check, if enough data is available. +</p><dl> +<dt>Returns:</dt> +<dd> +flag indicating availability of enough data (boolean) +</dd> +</dl><a NAME="Connection.__processData" ID="Connection.__processData"></a> +<h4>Connection.__processData</h4> +<b>__processData</b>(<i></i>) +<p> + Private method to process the received data. +</p><a NAME="Connection.__processReadyRead" ID="Connection.__processReadyRead"></a> +<h4>Connection.__processReadyRead</h4> +<b>__processReadyRead</b>(<i></i>) +<p> + Private slot to handle the readyRead signal. +</p><a NAME="Connection.__readDataIntoBuffer" ID="Connection.__readDataIntoBuffer"></a> +<h4>Connection.__readDataIntoBuffer</h4> +<b>__readDataIntoBuffer</b>(<i>maxSize = MaxBufferSize</i>) +<p> + Private method to read some data into the buffer. +</p><dl> +<dt><i>maxSize</i></dt> +<dd> +maximum size of data to read (integer) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +size of data read (integer) +</dd> +</dl><a NAME="Connection.__readProtocolHeader" ID="Connection.__readProtocolHeader"></a> +<h4>Connection.__readProtocolHeader</h4> +<b>__readProtocolHeader</b>(<i></i>) +<p> + Private method to read the protocol header. +</p><dl> +<dt>Returns:</dt> +<dd> +flag indicating a successful read (boolean) +</dd> +</dl><a NAME="Connection.__sendGreetingMessage" ID="Connection.__sendGreetingMessage"></a> +<h4>Connection.__sendGreetingMessage</h4> +<b>__sendGreetingMessage</b>(<i></i>) +<p> + Private slot to send a greeting message. +</p><a NAME="Connection.__sendPing" ID="Connection.__sendPing"></a> +<h4>Connection.__sendPing</h4> +<b>__sendPing</b>(<i></i>) +<p> + Private slot to send a ping message. +</p><a NAME="Connection.name" ID="Connection.name"></a> +<h4>Connection.name</h4> +<b>name</b>(<i></i>) +<p> + Public method to get the connection name. +</p><dl> +<dt>Returns:</dt> +<dd> +connection name (string) +</dd> +</dl><a NAME="Connection.sendGetParticipants" ID="Connection.sendGetParticipants"></a> +<h4>Connection.sendGetParticipants</h4> +<b>sendGetParticipants</b>(<i></i>) +<p> + Public method to request a list of participants. +</p><a NAME="Connection.sendMessage" ID="Connection.sendMessage"></a> +<h4>Connection.sendMessage</h4> +<b>sendMessage</b>(<i>message</i>) +<p> + Public method to send a message. +</p><dl> +<dt><i>message</i></dt> +<dd> +message to be sent (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating a successful send (boolean) +</dd> +</dl><a NAME="Connection.sendParticipants" ID="Connection.sendParticipants"></a> +<h4>Connection.sendParticipants</h4> +<b>sendParticipants</b>(<i>participants</i>) +<p> + Public method to send the list of participants. +</p><dl> +<dt><i>participants</i></dt> +<dd> +list of participants (list of strings of "host:port") +</dd> +</dl><a NAME="Connection.serverPort" ID="Connection.serverPort"></a> +<h4>Connection.serverPort</h4> +<b>serverPort</b>(<i></i>) +<p> + Public method to get the server port. +</p><dl> +<dt>Returns:</dt> +<dd> +server port (integer) +</dd> +</dl><a NAME="Connection.setGreetingMessage" ID="Connection.setGreetingMessage"></a> +<h4>Connection.setGreetingMessage</h4> +<b>setGreetingMessage</b>(<i>message, serverPort</i>) +<p> + Public method to set the greeting message. +</p><dl> +<dt><i>message</i></dt> +<dd> +greeting message (string) +</dd> +</dl><a NAME="Connection.timerEvent" ID="Connection.timerEvent"></a> +<h4>Connection.timerEvent</h4> +<b>timerEvent</b>(<i>evt</i>) +<p> + Protected method to handle timer events. +</p><dl> +<dt><i>evt</i></dt> +<dd> +reference to the timer event (QTimerEvent) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file