Package twisted :: Package internet :: Module tcp :: Class BaseClient

[show private | hide private]
[frames | no frames]

## Class BaseClient

        Logger --+
                 |
     Ephemeral --+
                 |
    FileDescriptor --+
                     |
            Connection --+
                         |
                        BaseClient

Known Subclasses:
  `Client`, `Client`

A base class for client TCP (and similiar) sockets.

Method Summary
| `__init__(self, skt, protocol, reactor)` (inherited from `Connection`)
| `__getstate__(self)` (inherited from `Ephemeral`)
| `__setstate__(self, state)` (inherited from `Ephemeral`)
| ``connectionLost`(self, reason)` See abstract.FileDescriptor.connectionLost().
| ``createInternetSocket`(self)` (internal) Create a non-blocking socket using self.addressFamily, self.socketType.
| ``doConnect`(self)` I connect the socket.
| ``doRead`(self)` Calls self.protocol.dataReceived with all available data. (inherited from `Connection`)
| ``doWrite`(self)` Called when data is available for writing. (inherited from `FileDescriptor`)
| `failIfNotConnected(self, err)`
| ``fileno`(self)` File Descriptor number for select(). (inherited from `FileDescriptor`)
| `getTcpNoDelay(self)` (inherited from `Connection`)
| `log(self, bytes)` (inherited from `Logger`)
| ``logPrefix`(self)` Return the prefix to log with when I own the logging thread. (inherited from `Connection`)
| ``loseConnection`(self)` Close the connection at the next available opportunity. (inherited from `FileDescriptor`)
| `pauseProducing(self)` (inherited from `FileDescriptor`)
| ``registerProducer`(self, producer, streaming)` Register to receive data from a producer. (inherited from `FileDescriptor`)
| `resolveAddress(self)`
| `resumeProducing(self)` (inherited from `FileDescriptor`)
| `setTcpNoDelay(self, enabled)` (inherited from `Connection`)
| ``startReading`(self)` Start waiting for read availability. (inherited from `FileDescriptor`)
| ``startWriting`(self)` Start waiting for write availability. (inherited from `FileDescriptor`)
| ``stopConnecting`(self)` Stop attempt to connect.
| ``stopConsuming`(self)` Stop consuming data. (inherited from `FileDescriptor`)
| `stopProducing(self)` (inherited from `FileDescriptor`)
| ``stopReading`(self)` Stop waiting for read availability. (inherited from `FileDescriptor`)
| ``stopWriting`(self)` Stop waiting for write availability. (inherited from `FileDescriptor`)
| ``unregisterProducer`(self)` Stop consuming data from a producer, without disconnecting. (inherited from `FileDescriptor`)
| ``write`(self, data)` Reliably write some data. (inherited from `FileDescriptor`)
| `writeSequence(self, iovec)` (inherited from `FileDescriptor`)
| ``writeSomeData`(self, data)` Connection.writeSomeData(data) -> #of bytes written | CONNECTION_LOST This writes as much data as possible to the socket and returns either the number of bytes read (which is positive) or a connection error code (which is negative) (inherited from `Connection`)

Class Variable Summary
`int` | `addressFamily`
`int` | `socketType`

Method Details

### connectionLost(self, reason)

See abstract.FileDescriptor.connectionLost().

  Overrides:
    `twisted.internet.tcp.Connection.connectionLost` (inherited documentation)

### createInternetSocket(self)

(internal) Create a non-blocking socket using self.addressFamily, self.socketType.

### doConnect(self)

I connect the socket.

Then, call the protocol's makeConnection, and start waiting for data.

### stopConnecting(self)

Stop attempt to connect.

Class Variable Details

### addressFamily

  Type:
    `int`
  Value:

        2

### socketType

  Type:
    `int`
  Value:

        1

Generated by Epydoc 1.1 on Sat Feb 15 21:17:52 2003 | http://epydoc.sf.net