Package xmpp :: Module transports :: Class TCPsocket
[show private | hide private]
[frames | no frames]

Class TCPsocket

PlugIn --+
         |
        TCPsocket

Known Subclasses:
HTTPPROXYsocket

This class defines direct TCP connection method.
Method Summary
  __init__(self, server)
Cache connection point 'server'.
  connect(self, server)
Try to connect.
  disconnect(self)
Closes the socket.
  disconnected(self)
Called when a Network Error or disconnection occurs.
  getHost(self)
Return the 'host' value that is connection is [will be] made to.
  getPort(self)
Return the 'port' value that is connection is [will be] made to.
  pending_data(self, timeout)
Returns true if there is a data ready to be read.
  plugin(self, owner)
Fire up connection.
  plugout(self)
Disconnect from the remote server and unregister self.disconnected method from the owner's dispatcher.
  receive(self)
Reads all pending incoming data.
  send(self, raw_data)
Writes raw outgoing data.
    Inherited from PlugIn
  DEBUG(self, text, severity)
Feed a provided debug line to main instance's debug facility along with our ID string.
  PlugIn(self, owner)
Attach to main instance and register ourself and all our staff in it.
  PlugOut(self)
Unregister all our staff from main instance and detach from it.

Method Details

__init__(self, server=None)
(Constructor)

Cache connection point 'server'. 'server' is the tuple of (host, port) absolutely the same as standart tcp socket uses.
Overrides:
xmpp.client.PlugIn.__init__

connect(self, server=None)

Try to connect. Returns non-empty string on success.

disconnect(self)

Closes the socket.

disconnected(self)

Called when a Network Error or disconnection occurs. Designed to be overidden.

getHost(self)

Return the 'host' value that is connection is [will be] made to.

getPort(self)

Return the 'port' value that is connection is [will be] made to.

pending_data(self, timeout=0)

Returns true if there is a data ready to be read.

plugin(self, owner)

Fire up connection. Return non-empty string on success. Also registers self.disconnected method in the owner's dispatcher. Called internally.

plugout(self)

Disconnect from the remote server and unregister self.disconnected method from the owner's dispatcher.

receive(self)

Reads all pending incoming data. In case of disconnection calls owner's disconnected() method and then raises IOError exception.

send(self, raw_data)

Writes raw outgoing data. Blocks until done. If supplied data is unicode string, encodes it to utf-8 before send.

Generated by Epydoc 2.1 on Wed May 4 07:28:29 2005 http://epydoc.sf.net