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

Class BaseClient

                     object --+    
                              |    
                _BaseBaseClient --+
                                  |
                     object --+   |
                              |   |
            _newtls.ClientMixin --+
                                  |
                 object --+       |
                          |       |
    _newtls.ConnectionMixin --+   |
                              |   |
             object --+       |   |
                      |       |   |
abstract._ConsumerMixin --+   |   |
                          |   |   |
             object --+   |   |   |
                      |   |   |   |
     abstract._LogOwner --+   |   |
                          |   |   |
    abstract.FileDescriptor --+   |
                              |   |
                 object --+   |   |
                          |   |   |
              _SocketCloser --+   |
                              |   |
                 object --+   |   |
                          |   |   |
             _AbortingMixin --+   |
                              |   |
                     Connection --+
                                  |
                                 BaseClient
Known Subclasses:

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

Nested Classes [hide private]
type _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 _newtls.ConnectionMixin: __providedBy__, loseConnection, registerProducer, startTLS, unregisterProducer, write, writeSequence

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

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

Inherited from abstract._LogOwner (private): _getLogPrefix

Inherited from _AbortingMixin: abortConnection

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from Connection: __implemented__

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

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

Inherited from _SocketCloser (private): _socketShutdownMethod

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 _newtls.ClientMixin (private): _tlsClientDefault

Inherited from Connection: logstr

Inherited from _newtls.ConnectionMixin: TLS

Inherited from abstract._ConsumerMixin: producer, producerPaused, streamingProducer

Inherited from _AbortingMixin (private): _aborting

Properties [hide private]

Inherited from object: __class__

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