Contents

send(_:metadata:)

Send binary frame on a WebSocket connection.

Declaration

func send<Content>(_ content: Content, @ProtocolMetadataBuilder metadata builder: () -> [NWProtocolMetadata] = {[]}) async throws where Content : DataProtocol

Parameters

  • content:

    Data to send.

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