send(_:metadata:)
Send data on a connection.
Declaration
func send<Sending, Receiving, CoderType>(_ content: Sending, @ProtocolMetadataBuilder metadata builder: () -> [NWProtocolMetadata] = {[]}) async throws where ApplicationProtocol == Coder<Sending, Receiving, CoderType>, Sending : Encodable, Receiving : Decodable, CoderType : NetworkCoderParameters
- content:
Object to send. The object will be encoded and then sent.
- builder:
A builder for specifying metadata about the content to send.
Discussion
This may be called before the connection is ready, in which case the send will be enqueued until the connection is ready to send.