class _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 | do |
Calls {IProtocol.dataReceived} with all available data and IFileDescriptorReceiver.fileDescriptorReceived once for each received file descriptor in ancillary data. |
Method | send |
Queue the given file descriptor to be sent and start trying to send it. |
Method | write |
Send as much of data as possible. Also send any pending file descriptors. |
Method | _ancillary |
Processes ancillary data with level SOL_SOCKET and type SCM_RIGHTS, indicating that the ancillary data payload holds file descriptors. |
Method | _is |
Determine whether the user-space send buffer for this transport is full or not. |
Instance Variable | _file |
An int giving the maximum number of file descriptors to accept and queue for sending before pausing the registered producer, if there is one. |
Instance Variable | _sendmsg |
A list of int holding file descriptors which are currently buffered before being sent. |
Instance Variable | _write |
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. |
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 | |
cmsgbytes | Ancillary data payload. |
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. |
An int giving the maximum number of file descriptors to accept and queue for sending before pausing the registered producer, if there is one.
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.