Package nbxmpp :: Module transports_nb
[hide private]
[frames] | no frames]

Module transports_nb

source code

Transports are objects responsible for connecting to XMPP server and putting data to wrapped sockets in in desired form (SSL, TLS, TCP, for HTTP proxy, for SOCKS5 proxy...)

Transports are not aware of XMPP stanzas and only responsible for low-level connection handling.

Classes [hide private]
  NonBlockingTransport
Abstract class representing a transport
  NonBlockingTCP
Non-blocking TCP socket wrapper
  NonBlockingHTTP
Socket wrapper that creates HTTP message out of sent data and peels-off HTTP headers from incoming messages
  NonBlockingHTTPBOSH
Class for BOSH HTTP connections. Slightly redefines HTTP transport by calling bosh bodytag generating callback before putting data on wire
Functions [hide private]
 
urisplit(uri)
Function for splitting URI string to tuple (protocol, host, port, path). e.g. urisplit('http://httpcm.jabber.org:123/webclient') returns ('http', 'httpcm.jabber.org', 123, '/webclient') return 443 as default port if proto is https else 80
source code
 
get_proxy_data_from_dict(proxy) source code
Variables [hide private]
  log = logging.getLogger('nbxmpp.transports_nb')
  CONNECT_TIMEOUT_SECONDS = 30
timeout to connect to the server socket, it doesn't include auth
  DISCONNECT_TIMEOUT_SECONDS = 5
how long to wait for a disconnect to complete
  RECV_BUFSIZE = 32768
size of the buffer which reads data from server
  DATA_RECEIVED = 'DATA RECEIVED'
  DATA_SENT = 'DATA SENT'
  DATA_ERROR = 'DATA ERROR'
  DISCONNECTED = 'DISCONNECTED'
  DISCONNECTING = 'DISCONNECTING'
  CONNECTING = 'CONNECTING'
  PROXY_CONNECTING = 'PROXY_CONNECTING'
  CONNECTED = 'CONNECTED'
  STATES = ('DISCONNECTED', 'CONNECTING', 'PROXY_CONNECTING', 'C...
  __package__ = 'nbxmpp'

Imports: ustr, PlugIn, IdleObject, proxy_connectors, tls_nb, socket, errno, time, traceback, base64, urlparse, logging


Function Details [hide private]

urisplit(uri)

source code 
Function for splitting URI string to tuple (protocol, host, port, path). e.g. urisplit('http://httpcm.jabber.org:123/webclient') returns ('http', 'httpcm.jabber.org', 123, '/webclient') return 443 as default port if proto is https else 80

get_proxy_data_from_dict(proxy)

source code 

Variables Details [hide private]

log

Value:
logging.getLogger('nbxmpp.transports_nb')

CONNECT_TIMEOUT_SECONDS

timeout to connect to the server socket, it doesn't include auth
Value:
30

DISCONNECT_TIMEOUT_SECONDS

how long to wait for a disconnect to complete
Value:
5

RECV_BUFSIZE

size of the buffer which reads data from server
Value:
32768

DATA_RECEIVED

Value:
'DATA RECEIVED'

DATA_SENT

Value:
'DATA SENT'

DATA_ERROR

Value:
'DATA ERROR'

DISCONNECTED

Value:
'DISCONNECTED'

DISCONNECTING

Value:
'DISCONNECTING'

CONNECTING

Value:
'CONNECTING'

PROXY_CONNECTING

Value:
'PROXY_CONNECTING'

CONNECTED

Value:
'CONNECTED'

STATES

Value:
('DISCONNECTED',
 'CONNECTING',
 'PROXY_CONNECTING',
 'CONNECTED',
 'DISCONNECTING')

__package__

Value:
'nbxmpp'