The connection module

The connection module contains the Connection class which provides the base functionality for creating concrete connections between two networked computers.

The Connection class

Inheritance diagram of pysiriproxy.connections.connection.Connection

class pysiriproxy.connections.connection.Connection(name, direction, logger, logColor=0)[source]

The Connection class implements the base functionaltiy for creating a concrete twisted internet protocol which is able to receive data in the form of lines.

This base class implements the functionality of receiving data from the iPhone or from the Guzzoni web server. The iPhone and Guzzoni web server transmit plist objects which are compressed using zlib compression. This class implements the necessary functionality for receiving the data, and decompressing it to retrieve the plist object data that is being transmitted.

The Connection objects are connected to the ConnectionManager which provides the ability for one Connection to forward data to another Connection.

Note

This class is intended to be subclassed to create a connection between two specific machines.

connectionFailed(reason)[source]

This function is called when a connection failed.

  • reason – The reason the connection was lost
connectionLost(reason)[source]

This function is called when a connection is lost.

  • reason – The reason the connection was lost
connectionMade()[source]

This function is called when a connection is made.

getDirection()[source]

Get the direction for this connection.

getMode()[source]

Get the current receiving mode the server is in.

getRefId()[source]

Get the most recently used reference id.

injectObjectToOutputStream(obj)[source]

Inject the given object into the output stream of this connection. This effectively sends the object to the foward destination connection for this connection.

  • obj – The object to inject into the output stream
lineReceived(line)[source]

This function is called when a line of data is received.

  • line – The line of data
rawDataReceived(data)[source]

This function is called when raw data is received.

  • data – The raw data
reset()[source]

Reset this connection.

setLineMode()[source]

Set the server to receive lines.

setRawMode()[source]

Set the server to receive raw data.

setRefId(refId)[source]

Set the reference id.

  • refId – The reference id

Table Of Contents

Previous topic

The connections module

Next topic

The iphone module

This Page