class twisted.internet.unix._SendmsgMixin: (source)
Known subclasses: twisted.internet.unix.Client, twisted.internet.unix.Server
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. |
writeSomeData
. Ultimately this should be a subclass of twisted.internet.abstract.FileDescriptor
. Subclasses which mix in _SendmsgMixin
must define this.Optional[Type[FileDescriptor]]
)
list
of int
holding file descriptors which are currently buffered before being sent.list
)
int
giving the maximum number of file descriptors to accept and queue for sending before pausing the registered producer, if there is one.int
)
Undocumented
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.
Returns | True if it is full, False otherwise. |
Queue the given file descriptor to be sent and start trying to send it.
Send as much of data
as possible. Also send any pending file descriptors.
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.
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
.
Parameters | cmsgData | Ancillary data payload. (type: bytes ) |