UnixConnection.send

SendStatus send(scope const(ubyte)[] data) @trusted

Send bytes over the connection.

Data is copied into an internal send queue. The caller may reuse or free the buffer immediately after this method returns.

Backpressure: returns a SendError with reason SendErrorReason.PRESSURE when the internal queue would exceed the configured highWaterMark or the global EventLoop send queue limit. The caller must wait for onWritable before retrying.

Parameters

dataBytes to send.

Returns

SendStatus send(scope const(ubyte)[] data, scope const(Handle)[] descriptors) @trusted

Send bytes and pass open descriptors over the connection (SCM_RIGHTS).

On success the bytes are Copied into the internal send queue (as with send(data)) and each descriptor is duplicated into a queue-Owned close-on-exec handle; the caller retains ownership of the originals and may close or reuse them immediately after this method returns. A rejected call closes the tentative duplicates and enqueues nothing.

Descriptors form an ordered stream independent of the byte stream: the peer collects them FIFO through ReceivedDescriptors, with no association to a byte offset. Queued descriptors are attached to the first positive sendmsg of their output chunk and are never sent twice; abort, close or cancellation releases them exactly once.

Parameters

dataBytes to send; must not be empty when descriptors are given.
descriptorsOpen descriptors to pass; at most UNIX_MAX_DESCRIPTORS_PER_SEND per call.

Returns