Script transports_nb_py_orig :: Class NonBlockingTransport
[hide private]
[frames] | no frames]

Class NonBlockingTransport


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
 
plugin(self, owner)
 
plugout(self)
 
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
 
set_state(self, newstate)
 
get_state(self)
 
_on_connect(self)
Preceeds call of on_connect callback
 
_on_connect_failure(self, err_message)
Preceeds call of on_connect_failure callback
 
send(self, raw_data, now=False)
 
disconnect(self, do_callback=True)
 
onreceive(self, recv_handler)
Set the on_receive callback.
 
_tcp_connecting_started(self)
 
read_timeout(self)
Called when there's no response from server in defined timeout
 
read_timeout2(self)
called when there's no response from server in defined timeout
 
renew_send_timeout(self)
 
renew_send_timeout2(self)
 
set_timeout(self, timeout)
 
set_timeout2(self, timeout2)
 
get_fd(self)
 
remove_timeout(self)
 
set_send_timeout(self, timeout, on_timeout)
 
set_send_timeout2(self, timeout2, on_timeout2)
 
start_disconnect(self)

Inherited from nbxmpp.plugin.PlugIn: PlugIn, PlugOut

Class Methods [hide private]

Inherited from nbxmpp.plugin.PlugIn: get_instance

Method Details [hide private]

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

 
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: nbxmpp.plugin.PlugIn.__init__

plugin(self, owner)

 

plugout(self)

 

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
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)

 

get_state(self)

 

_on_connect(self)

 
Preceeds call of on_connect callback

_on_connect_failure(self, err_message)

 
Preceeds call of on_connect_failure callback

send(self, raw_data, now=False)

 

disconnect(self, do_callback=True)

 

onreceive(self, recv_handler)

 

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)

 

read_timeout(self)

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

read_timeout2(self)

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

renew_send_timeout(self)

 

renew_send_timeout2(self)

 

set_timeout(self, timeout)

 

set_timeout2(self, timeout2)

 

get_fd(self)

 

remove_timeout(self)

 

set_send_timeout(self, timeout, on_timeout)

 

set_send_timeout2(self, timeout2, on_timeout2)

 

start_disconnect(self)