Module Connector

This module implements a Python wrapper around the ZorpConnect class implemented in C.

Imported modules

Class Connect

This class is a simple wrapper around the ZorpConnect class implemented by the Zorp core, and as such it'll be a placeholder for extensions implemented in Python.

Attributes

Table 4-19. Attributes for class Connect

local Address of local end of the connection
remote Address where we connect
connecta Zorp.Connect object

Constructor __init__

Initializes a Connect instance.

Synopsis

__init__ (
        self,
        local,
        remote,
        callback=None,
        )

Description

Sets the attributes based on constructor parameters, and start connecting in a separate thread if callback is not None.

Arguments

Table 4-20. Arguments for Connect.__init__()

self this instance
local Address of local end of the connection
remote Address where we connect
callbackCallback to be called when the connection is established. If this is None callback is not used, and blockingConnect should be called to really establish a connection.

Method blockingConnect

Establish a connection in blocking mode.

Synopsis

blockingConnect ( self )

Description

Establishes the connection and returns its file descriptor.

Arguments

Table 4-21. Arguments for Connect.blockingConnect()

self this instance

Returns

the fd

Method destroy

Destroy this connector instance.

Synopsis

destroy ( self )

Description

Stop connecting and destroy the underlying ZorpConnect instance.

Arguments

Table 4-22. Arguments for Connect.destroy()

selfinstance