UnixConnection.send

SendResult 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 SendResult.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

  • SendResult.OK — all bytes accepted (sent to OS or queued)
  • SendResult.PRESSURE — zero bytes queued, budget exceeded
  • SendResult.CLOSED — connection not in CONNECTED state
  • SendResult.ERROR — system error, check errno