Skip to content

Commit

Permalink
Changed L2CAPSocket from Class to Actor
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Apr 25, 2022
1 parent 7fa6109 commit 4a436dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/BluetoothLinux/L2CAP/L2CAPSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SystemPackage
import Socket

/// L2CAP Bluetooth socket
public final class L2CAPSocket: Bluetooth.L2CAPSocket {
public actor L2CAPSocket: Bluetooth.L2CAPSocket {

// MARK: - Properties

Expand All @@ -25,15 +25,15 @@ public final class L2CAPSocket: Bluetooth.L2CAPSocket {
/// L2CAP Socket address
public let address: BluetoothAddress

public lazy var event: L2CAPSocketEventStream = { [unowned self] in
public nonisolated var event: L2CAPSocketEventStream {
let stream = self.socket.event
var iterator = stream.makeAsyncIterator()
return L2CAPSocketEventStream(unfolding: {
await iterator
.next()
.map { L2CAPSocketEvent($0) }
})
}()
}

// MARK: - Initialization

Expand Down

0 comments on commit 4a436dc

Please sign in to comment.