Known subclasses: twisted.internet.unix.Client, twisted.internet.unix.Server

Implements interfaces: twisted.internet.interfaces.IUNIXTransport

Mixin for stream-oriented UNIX transports which uses sendmsg and recvmsg to offer additional functionality, such as copying file descriptors into other processes.

Method __init__ Undocumented
Method sendFileDescriptor Queue the given file descriptor to be sent and start trying to send it.
Method writeSomeData Send as much of data as possible. Also send any pending file descriptors.
Method doRead Calls {IProtocol.dataReceived} with all available data and IFileDescriptorReceiver.fileDescriptorReceived once for each received file descriptor in ancillary data.
Instance Variable _writeSomeDataBase The class which provides the basic implementation of writeSomeData. Ultimately this should be a subclass of twisted.internet.abstract.FileDescriptor. Subclasses which mix in _SendmsgMixin must define this.
Instance Variable _sendmsgQueue A list of int holding file descriptors which are currently buffered before being sent.
Instance Variable _fileDescriptorBufferSize An int giving the maximum number of file descriptors to accept and queue for sending before pausing the registered producer, if there is one.
Method _isSendBufferFull Determine whether the user-space send buffer for this transport is full or not.
Method _ancillaryLevelSOLSOCKETTypeSCMRIGHTS Processes ancillary data with level SOL_SOCKET and type SCM_RIGHTS, indicating that the ancillary data payload holds file descriptors.
_writeSomeDataBase =
The class which provides the basic implementation of writeSomeData. Ultimately this should be a subclass of twisted.internet.abstract.FileDescriptor. Subclasses which mix in _SendmsgMixin must define this.
_sendmsgQueue =
A list of int holding file descriptors which are currently buffered before being sent.
_fileDescriptorBufferSize =
An int giving the maximum number of file descriptors to accept and queue for sending before pausing the registered producer, if there is one.
def __init__(self): (source)
def _isSendBufferFull(self): (source)

Determine whether the user-space send buffer for this transport is full or not.

This extends the base determination by adding consideration of how many file descriptors need to be sent using sendmsg.sendmsg. When there are more than self._fileDescriptorBufferSize, the buffer is considered full.

ReturnsTrue if it is full, False otherwise.
def sendFileDescriptor(self, fileno): (source)

Queue the given file descriptor to be sent and start trying to send it.

def writeSomeData(self, data): (source)

Send as much of data as possible. Also send any pending file descriptors.

def doRead(self): (source)

Calls {IProtocol.dataReceived} with all available data and IFileDescriptorReceiver.fileDescriptorReceived once for each received file descriptor in ancillary data.

This reads up to self.bufferSize bytes of data from its socket, then dispatches the data to protocol callbacks to be handled. If the connection is not lost through an error in the underlying recvmsg(), this function will return the result of the dataReceived call.

def _ancillaryLevelSOLSOCKETTypeSCMRIGHTS(self, cmsgData): (source)

Processes ancillary data with level SOL_SOCKET and type SCM_RIGHTS, indicating that the ancillary data payload holds file descriptors.

Calls IFileDescriptorReceiver.fileDescriptorReceived once for each received file descriptor or logs a message if the protocol does not implement IFileDescriptorReceiver.

ParameterscmsgDataAncillary data payload. (type: bytes)
API Documentation for Twisted, generated by pydoctor at 2019-08-06 12:10:50.