Package xmpp :: Module filetransfer :: Class IBB
[hide private]
[frames] | no frames]

Class IBB

source code

client.PlugIn --+
                |
               IBB

IBB used to transfer small-sized data chunk over estabilished xmpp connection. Data is split into small blocks (by default 3000 bytes each), encoded as base 64 and sent to another entity that compiles these blocks back into the data chunk. This is very inefficiend but should work under any circumstances. Note that using IBB normally should be the last resort.

Instance Methods [hide private]
 
__init__(self)
Initialise internal variables.
source code
 
plugin(self, owner)
Register handlers for receiving incoming datastreams.
source code
 
IqHandler(self, conn, stanza)
Handles streams state change.
source code
 
StreamOpenHandler(self, conn, stanza)
Handles opening of new incoming stream.
source code
 
OpenStream(self, sid, to, fp, blocksize=3000)
Start new stream.
source code
 
SendHandler(self, conn)
Send next portion of data if it is time to do it.
source code
 
ReceiveHandler(self, conn, stanza)
Receive next portion of incoming datastream and store it write it to temporary file.
source code
 
StreamCloseHandler(self, conn, stanza)
Handle stream closure due to all data transmitted.
source code
 
StreamBrokenHandler(self, conn, stanza)
Handle stream closure due to all some error while receiving data.
source code
 
StreamOpenReplyHandler(self, conn, stanza)
Handle remote side reply about is it agree or not to receive our datastream.
source code

Inherited from client.PlugIn: DEBUG, PlugIn, PlugOut

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Initialise internal variables.
Overrides: client.PlugIn.__init__

plugin(self, owner)

source code 
Register handlers for receiving incoming datastreams. Used internally.

IqHandler(self, conn, stanza)

source code 
Handles streams state change. Used internally.

StreamOpenHandler(self, conn, stanza)

source code 
Handles opening of new incoming stream. Used internally.

OpenStream(self, sid, to, fp, blocksize=3000)

source code 
Start new stream. You should provide stream id 'sid', the endpoind jid 'to', the file object containing info for send 'fp'. Also the desired blocksize can be specified. Take into account that recommended stanza size is 4k and IBB uses base64 encoding that increases size of data by 1/3.

SendHandler(self, conn)

source code 
Send next portion of data if it is time to do it. Used internally.

ReceiveHandler(self, conn, stanza)

source code 
Receive next portion of incoming datastream and store it write it to temporary file. Used internally.

StreamCloseHandler(self, conn, stanza)

source code 
Handle stream closure due to all data transmitted. Raise xmpppy event specifying successfull data receive.

StreamBrokenHandler(self, conn, stanza)

source code 
Handle stream closure due to all some error while receiving data. Raise xmpppy event specifying unsuccessfull data receive.

StreamOpenReplyHandler(self, conn, stanza)

source code 
Handle remote side reply about is it agree or not to receive our datastream. Used internally. Raises xmpppy event specfiying if the data transfer is agreed upon.