Skip to content

Commit 4c859eb

Browse files
committed
name AsyncThrowingStream field 'stream' not 'channel'
1 parent 1716b79 commit 4c859eb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Sources/SwiftOCA/OCP.1/Backend/Ocp1CFSocketConnection.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,19 @@ Sendable, CustomStringConvertible, Hashable {
112112
}
113113
}
114114

115-
private let channel: AsyncThrowingStream<Element, Error>
115+
private let stream: AsyncThrowingStream<Element, Error>
116116
private let continuation: AsyncThrowingStream<Element, Error>.Continuation
117117
private var receivedData: Data!
118118
private var cfSocket: CFSocket!
119119
private let isDatagram: Bool
120120
private var runLoopSource: CFRunLoopSource!
121121

122122
public var acceptedSockets: AnyAsyncSequence<_CFSocketWrapper> {
123-
channel.map(\.nativeHandle).eraseToAnyAsyncSequence()
123+
stream.map(\.nativeHandle).eraseToAnyAsyncSequence()
124124
}
125125

126126
public var receivedMessages: AnyAsyncSequence<CFSocket.Message> {
127-
channel.map(\.message).eraseToAnyAsyncSequence()
127+
stream.map(\.message).eraseToAnyAsyncSequence()
128128
}
129129

130130
fileprivate nonisolated func dataCallBack(
@@ -197,7 +197,7 @@ Sendable, CustomStringConvertible, Hashable {
197197
}
198198
isDatagram = type == SOCK_DGRAM
199199

200-
(channel, continuation) = AsyncThrowingStream.makeStream(of: Element.self, throwing: Error.self)
200+
(stream, continuation) = AsyncThrowingStream.makeStream(of: Element.self, throwing: Error.self)
201201

202202
var context = CFSocketContext()
203203
context.info = Unmanaged.passUnretained(self).toOpaque()
@@ -253,7 +253,7 @@ Sendable, CustomStringConvertible, Hashable {
253253
init(nativeHandle: CFSocketNativeHandle) throws {
254254
isDatagram = false
255255

256-
(channel, continuation) = AsyncThrowingStream.makeStream(of: Element.self, throwing: Error.self)
256+
(stream, continuation) = AsyncThrowingStream.makeStream(of: Element.self, throwing: Error.self)
257257

258258
var context = CFSocketContext()
259259
context.info = Unmanaged.passUnretained(self).toOpaque()
@@ -293,7 +293,7 @@ Sendable, CustomStringConvertible, Hashable {
293293
private func drainChannel(atLeast length: Int) async throws {
294294
guard receivedData.count < length else { return }
295295

296-
for try await data in channel {
296+
for try await data in stream {
297297
receivedData += data.data
298298
guard receivedData.count < length else { return }
299299
}

0 commit comments

Comments
 (0)