Package nbxmpp :: Module transports_nb :: Class NonBlockingTransport

[hide private]
[frames] | no frames]

# Class NonBlockingTransport

source code

Abstract class representing a transport

Subclasses CAN have different constructor signature but connect method SHOULD be the same.

Instance Methods | [hide private]

__init__(self, raise_event, on_disconnect, idlequeue, estabilish_tls, certs) Each trasport class can have different constructor but it has to have at least all the arguments of NonBlockingTransport constructor | source code

plugin(self, owner) | source code

plugout(self) | source code

connect(self, conn_5tuple, on_connect, on_connect_failure) Creates and connects transport to server and port defined in conn_5tuple which should be item from list returned from getaddrinfo | source code

set_state(self, newstate) | source code

get_state(self) | source code

_on_connect(self) Preceeds call of on_connect callback | source code

_on_connect_failure(self, err_message) Preceeds call of on_connect_failure callback | source code

send(self, raw_data, now=False) | source code

disconnect(self, do_callback=True) | source code

onreceive(self, recv_handler) Set the on_receive callback. | source code

_tcp_connecting_started(self) | source code

read_timeout(self) Called when there's no response from server in defined timeout | source code

read_timeout2(self) called when there's no response from server in defined timeout | source code

renew_send_timeout(self) | source code

renew_send_timeout2(self) | source code

set_timeout(self, timeout) | source code

set_timeout2(self, timeout2) | source code

get_fd(self) | source code

remove_timeout(self) | source code

set_send_timeout(self, timeout, on_timeout) | source code

set_send_timeout2(self, timeout2, on_timeout2) | source code

start_disconnect(self) | source code

Inherited from `plugin.PlugIn`: `PlugIn`, `PlugOut`

Class Methods | [hide private]

Inherited from `plugin.PlugIn`: `get_instance`

Method Details | [hide private]

### __init__(self, raise_event, on_disconnect, idlequeue, estabilish_tls, certs)
(Constructor)

source code

Each trasport class can have different constructor but it has to have at least all the arguments of NonBlockingTransport constructor

Parameters:
  - `raise_event` - callback for monitoring of sent and received data
  - `on_disconnect` - callback called on disconnection during runtime
  - `idlequeue` - processing idlequeue
  - `estabilish_tls` - boolean whether to estabilish TLS connection after TCP connection is done
  - `certs` - tuple of (cacerts, mycerts) see constructor of tls_nb.NonBlockingTLS for more details
Overrides: plugin.PlugIn.__init__

### plugin(self, owner)

source code

### plugout(self)

source code

### connect(self, conn_5tuple, on_connect, on_connect_failure)

source code

Creates and connects transport to server and port defined in conn_5tuple which should be item from list returned from getaddrinfo

Parameters:
  - `conn_5tuple` - 5-tuple returned from getaddrinfo
  - `on_connect` - callback called on successful connect to the server
  - `on_connect_failure` - callback called on failure when connecting

### set_state(self, newstate)

source code

### get_state(self)

source code

### _on_connect(self)

source code

Preceeds call of on_connect callback

### _on_connect_failure(self, err_message)

source code

Preceeds call of on_connect_failure callback

### send(self, raw_data, now=False)

source code

### disconnect(self, do_callback=True)

source code

### onreceive(self, recv_handler)

source code

Set the on_receive callback.

onreceive(None) sets callback to Dispatcher.ProcessNonBlocking which is the default one that will decide what to do with received stanza based on its tag name and namespace.

Do not confuse it with on_receive() method, which is the callback itself.

### _tcp_connecting_started(self)

source code

### read_timeout(self)

source code

Called when there's no response from server in defined timeout

### read_timeout2(self)

source code

called when there's no response from server in defined timeout

### renew_send_timeout(self)

source code

### renew_send_timeout2(self)

source code

### set_timeout(self, timeout)

source code

### set_timeout2(self, timeout2)

source code

### get_fd(self)

source code

### remove_timeout(self)

source code

### set_send_timeout(self, timeout, on_timeout)

source code

### set_send_timeout2(self, timeout2, on_timeout2)

source code

### start_disconnect(self)

source code