descriptor
TypeScriptget descriptor(): SDKHandleSwift declarationfinal let descriptor: any NWGroupDescriptorThe group descriptor used by the connection group.
class · iOS 14.0+ · SDK 27.1
final class NWConnectionGroupAn `NWConnectionGroup` is an object that represents an active session with multiple entities or resources on the network. This can be used to send and receive messages within the group, for example sending and receiving multicast traffic. You can create an `NWConnection` from a message to communicate with a single endpoint in the group.
get descriptor(): SDKHandleSwift declarationfinal let descriptor: any NWGroupDescriptorThe group descriptor used by the connection group.
get parameters(): NWParametersSwift declarationfinal let parameters: NWParametersThe set of parameters with which the connection group was created.
get debugDescription(): stringSwift declarationfinal var debugDescription: String { get }A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.
setReceiveHandler(maximumMessageSize?: number, rejectOversizedMessages?: boolean, handler?: (((arg0: NWConnectionGroup_Message, arg1: (ArrayBuffer) | null, arg2: boolean) => void)) | null): voidSwift declaration@preconcurrency final func setReceiveHandler(maximumMessageSize: Int = Int.max, rejectOversizedMessages: Bool = true, handler: (@Sendable (NWConnectionGroup.Message, Data?, Bool) -> Void)?)Provide a handler for any received messages sent from members of the group to the local endpoint. `maximumMessageSize` defines the size of the largest message that will be delivered to the handler closure. Defaults to `Int.max`. `rejectOversizedMessages` indicates whether or not messages larger than `maximumMessageSize` should be rejected. If `rejectOversizedMessages` is `false`, large messages will be sent to handler closure as partial messages. Defaults to `true`.
get stateUpdateHandler(): (((arg0: NWConnectionGroup_State) => Promise<void>)) | nullSwift declaration@preconcurrency final var stateUpdateHandler: (@Sendable (NWConnectionGroup.State) -> Void)? { get set }Set a block to be called when the group's state changes, which may be called multiple times until the group is cancelled.
set stateUpdateHandler(value: (((arg0: NWConnectionGroup_State) => void)) | null)Swift declaration@preconcurrency final var stateUpdateHandler: (@Sendable (NWConnectionGroup.State) -> Void)? { get set }Set a block to be called when the group's state changes, which may be called multiple times until the group is cancelled.
get newConnectionHandler(): (((arg0: NWConnection) => Promise<void>)) | nullSwift declaration@preconcurrency final var newConnectionHandler: (@Sendable (NWConnection) -> Void)? { get set }Handler to be called for new connections initiated by the peer of this group.
set newConnectionHandler(value: (((arg0: NWConnection) => void)) | null)Swift declaration@preconcurrency final var newConnectionHandler: (@Sendable (NWConnection) -> Void)? { get set }Handler to be called for new connections initiated by the peer of this group.
send(content: (ArrayBuffer) | null, to: (NWEndpoint) | null, message: NWConnectionGroup_Message, completion: ((arg0: (NWError) | null) => void)): voidSwift declaration@preconcurrency final func send(content: Data?, to: NWEndpoint? = nil, message: NWConnectionGroup.Message = .default, completion: @escaping (NWError?) -> Void)Send data to a particular endpoint within the group. The endpoint can represent multiple peers, such as an IP multicast address, or a specific peer in the group. If the endpoint is `nil`, the message will be sent to all members in the group. The endpoint defaults to `nil`. The message defaults to `.default`. The completion will be invoked with an optional error when the send operation has completed.
static init(with_: SDKHandle, using: NWParameters): NWConnectionGroupSwift declarationinit(with: any NWGroupDescriptor, using: NWParameters)Create a group with a descriptor, which identifies the group addresses for communication, and a set of parameters, which defines the protocols to use for communication with the group. Group creation can fail if the group descriptor is invalid.
get queue(): (_Dispatch_DispatchQueue) | nullSwift declarationfinal var queue: DispatchQueue? { get }Get queue used for delivering block handlers, such as `stateUpdateHandler`, `messageHandler`, and the completion to calls to `send`. If the group has not yet been started, the queue will be `nil`. Once the group has been started, the queue will be non-nil.
start(queue: _Dispatch_DispatchQueue): voidSwift declarationfinal func start(queue: DispatchQueue)Start the group and provide a queue on which callback handlers will be executed. Start should only be called once on a group, and multiple calls to start will be ignored.
get state(): NWConnectionGroup_StateSwift declarationfinal var state: NWConnectionGroup.State { get }cancel(): voidSwift declarationfinal func cancel()Cancel is asynchronous and the group state will eventually transition to `.cancelled`. Subsequent calls to `cancel` are ignored.
extract(connectionTo?: (NWEndpoint) | null, using?: (NWProtocolOptions) | null): (NWConnection) | nullSwift declarationfinal func extract(connectionTo: NWEndpoint? = nil, using: NWProtocolOptions? = nil) -> NWConnection?Extract a connection from the connection group. For a multiplex connection group, this means that a new stream is opened and the NWConnection object is returned. For non-multiplex connection groups, a connection to the specified endpoint will be returned if allowed by the group descriptor. The connection can be re-inserted into the group later. Once reinserted, the connection group will handle subsequent messages from this remote endpoint.
metadata(definition: NWProtocolDefinition): (NWProtocolMetadata) | nullSwift declarationfinal func metadata(definition: NWProtocolDefinition) -> NWProtocolMetadata?reinsert(connection: NWConnection): booleanSwift declarationfinal func reinsert(connection: NWConnection) -> BoolReinsert a connection into a connection group. Once reinserted, the connection group will handle subsequent messages from this remote endpoint, and any outstanding reads on the connection will be cancelled.
No declarations were skipped in this snapshot.