Go to the latest version of this document.

# ``twisted`.`internet`.`base`.`BaseConnector``

class documentation

`class BaseConnector(ABC): (source)`

Known subclasses: `twisted.internet.tcp.Connector`, `twisted.internet.unix.Connector`

Constructor: `BaseConnector(factory, timeout, reactor)`

Implements interfaces: `twisted.internet.interfaces.IConnector`

View In Hierarchy

Basic implementation of `IConnector`.

State can be: "connecting", "connected", "disconnected"

Method | `__init__` | Undocumented
Method | `__repr__` | Undocumented
Method | `buildProtocol` | Undocumented
Method | `cancelTimeout` | Undocumented
Method | `connect` | Start connection to remote server.
Method | `connectionFailed` | Undocumented
Method | `connectionLost` | Undocumented
Method | `disconnect` | Disconnect whatever our state is.
Method | `getDestination` | Return destination this will try to connect to.
Method | `stopConnecting` | Stop attempting to connect.
Instance Variable | `factory` | Undocumented
Instance Variable | `factoryStarted` | Undocumented
Instance Variable | `reactor` | Undocumented
Instance Variable | `state` | Undocumented
Instance Variable | `timeout` | Undocumented
Instance Variable | `timeoutID` | Undocumented
Instance Variable | `transport` | Undocumented
Method | `_makeTransport` | Undocumented

def __init__(self, factory: `ClientFactory`, timeout: `float`, reactor: `ReactorBase`): (source)
overridden in `twisted.internet.tcp.Connector`, `twisted.internet.unix.Connector`

Undocumented

def __repr__(self) -> `str`: (source)

Undocumented

def buildProtocol(self, addr: `IAddress`) -> `IProtocol | None`: (source)

Undocumented

def cancelTimeout(self): (source)

Undocumented

def connect(self): (source)
from `twisted.internet.interfaces.IConnector`

Start connection to remote server.

def connectionFailed(self, reason: `Failure`): (source)

Undocumented

def connectionLost(self, reason: `Failure`): (source)

Undocumented

def disconnect(self): (source)
from `twisted.internet.interfaces.IConnector`

Disconnect whatever our state is.

def getDestination(self) -> `IAddress`: (source)
from `twisted.internet.interfaces.IConnector`
overridden in `twisted.internet.tcp.Connector`, `twisted.internet.unix.Connector`

Return destination this will try to connect to.

Returns
`IAddress` | An object which provides `IAddress`.

def stopConnecting(self): (source)
from `twisted.internet.interfaces.IConnector`

Stop attempting to connect.

factory = (source)

Undocumented

factoryStarted: `int` = (source)

Undocumented

reactor = (source)

Undocumented

state: `str` = (source)

Undocumented

timeout = (source)

Undocumented

timeoutID = (source)

Undocumented

transport: `Client | None` = (source)

Undocumented

@abstractmethod
def _makeTransport(self) -> `Client`: (source)
overridden in `twisted.internet.tcp.Connector`, `twisted.internet.unix.Connector`

Undocumented