twisted :: internet :: tcp :: BaseClient :: Class BaseClient
[hide private]

type BaseClient

                     object --+    
                              |    
                _BaseBaseClient --+
                                  |
                     object --+   |
                              |   |
                _TLSClientMixin --+
                                  |
                 object --+       |
                          |       |
        _TLSConnectionMixin --+   |
                              |   |
             object --+       |   |
                      |       |   |
abstract._ConsumerMixin --+   |   |
                          |   |   |
             object --+   |   |   |
                      |   |   |   |
     abstract._LogOwner --+   |   |
                          |   |   |
    abstract.FileDescriptor --+   |
                              |   |
                 object --+   |   |
                          |   |   |
              _SocketCloser --+   |
                              |   |
                 object --+   |   |
                          |   |   |
             _AbortingMixin --+   |
                              |   |
                     Connection --+
                                  |
                                 BaseClient
Known Subclasses:

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

Nested Classes [hide private]
_commonConnection
Subclasses must provide this attribute, which indicates the Connection-alike class to invoke __init__ and connectionLost on.
Instance Methods [hide private]
 
_collectSocketDetails(self)
Clean up references to the attached socket in its underlying OS resource (such as a file descriptor or file handle), as part of post connection-failure cleanup.
 
_connectDone(self)
This is a hook for when a connection attempt has succeeded.
 
_stopReadingAndWriting(self)
Subclasses must implement in order to remove this transport from its reactor's notifications in response to a terminated connection attempt.
 
createInternetSocket(self)
(internal) Create a non-blocking socket using self.addressFamily, self.socketType.
 
doConnect(self)
Initiate the outgoing connection attempt.

Inherited from _BaseBaseClient: connectionLost, failIfNotConnected, resolveAddress, stopConnecting

Inherited from _BaseBaseClient (private): _finishInit, _setRealAddress

Inherited from Connection: __init__, __provides__, doRead, getHandle, getTcpKeepAlive, getTcpNoDelay, logPrefix, readConnectionLost, setTcpKeepAlive, setTcpNoDelay, writeSomeData

Inherited from Connection (private): _closeWriteConnection, _dataReceived

Inherited from _TLSConnectionMixin: __providedBy__

Inherited from abstract.FileDescriptor: doWrite, fileno, loseConnection, loseWriteConnection, pauseProducing, resumeProducing, startReading, startWriting, stopConsuming, stopProducing, stopReading, stopWriting, write, writeConnectionLost, writeSequence

Inherited from abstract.FileDescriptor (private): _isSendBufferFull, _maybePauseProducer, _postLoseConnection

Inherited from abstract._ConsumerMixin: registerProducer, unregisterProducer

Inherited from abstract._LogOwner (private): _getLogPrefix

Inherited from _AbortingMixin: abortConnection

Class Variables [hide private]

Inherited from Connection: __implemented__

Inherited from _TLSConnectionMixin: TLS

Inherited from abstract.FileDescriptor: SEND_LIMIT, bufferSize, connected, dataBuffer, disconnected, disconnecting, offset

Inherited from abstract.FileDescriptor (private): _writeDisconnected, _writeDisconnecting

Instance Variables [hide private]
_base
Connection, which is the base class of this class which has all of the useful file descriptor methods.
tuple realAddress
The address object that will be used for socket.connect; this address is an address tuple (the number of elements dependent upon the address family) which does not contain any names which need to be resolved.

Inherited from _BaseBaseClient: addressFamily, reactor, socketType

Inherited from _BaseBaseClient (private): _closeSocket, _requiresResolution

Inherited from Connection: logstr

Inherited from abstract._ConsumerMixin: producer, producerPaused, streamingProducer

Inherited from _SocketCloser (private): _shouldShutdown

Inherited from _AbortingMixin (private): _aborting

Method Details [hide private]

_collectSocketDetails(self)

 
Clean up references to the attached socket in its underlying OS resource (such as a file descriptor or file handle), as part of post connection-failure cleanup.
Overrides: _collectSocketDetails

See Also: _BaseBaseClient

_connectDone(self)

 

This is a hook for when a connection attempt has succeeded.

Here, we build the protocol from the twisted.internet.protocol.ClientFactory that was passed in, compute a log string, begin reading so as to send traffic to the newly built protocol, and finally hook up the protocol itself.

This hook is overridden by ssl.Client to initiate the TLS protocol.

_stopReadingAndWriting(self)

 
Subclasses must implement in order to remove this transport from its reactor's notifications in response to a terminated connection attempt.
Overrides: _stopReadingAndWriting

doConnect(self)

 

Initiate the outgoing connection attempt.

Note: Applications do not need to call this method; it will be invoked internally as part of IReactorTCP.connectTCP.


Instance Variable Details [hide private]

_base

Connection, which is the base class of this class which has all of the useful file descriptor methods. This is used by _TLSServerMixin to call the right methods to directly manipulate the transport, as is necessary for writing TLS-encrypted bytes (whereas those methods on Server will go through another layer of TLS if it has been enabled).
Value:
twisted.internet.tcp.Connection