write(_:file:line:)

Write data to the remote peer.

ChannelInvoker.swift:163

This declaration is deprecated: NIOAny is not Sendable. Avoid wrapping the value in NIOAny to silence this warning.

func write(_ data: NIOAny, file: StaticString = #fileID, line: UInt = #line) -> EventLoopFuture<Void>

Parameters

data

the data to write

file

The file this function was called in, for debugging purposes.

line

The line this function was called on, for debugging purposes.

Returns

the future which will be notified once the operation completes.

Be aware that to be sure that data is really written to the remote peer you need to call flush or use writeAndFlush. Calling write multiple times and then flush may allow the Channel to write multiple data objects to the remote peer with one syscall.