Skip to content

Commit 2f38202

Browse files
committed
refactor
1 parent e1ad0b1 commit 2f38202

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Sources/LCLWebSocket/Client/WebSocketClient.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ extension WebSocketClient {
368368
let device = findDevice(with: deviceName, protocol: resolvedAddress.protocol)
369369
{
370370
// bind to selected device, if any
371-
return bindTo(device: device, on: channel)
371+
logger.debug("deviceName \(deviceName), device \(device)")
372+
return bindTo(device, on: channel)
372373
}
373374

374375
return channel.eventLoop.makeSucceededVoidFuture()

Sources/LCLWebSocket/LCLWebSocket+ChannelInitializer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ typealias ChannelInitializer = @Sendable (Channel) -> EventLoopFuture<Void>
2020
/// - Parameters:
2121
/// - device: the device to bind to
2222
/// - on: the channel that will be bound to the device
23-
internal func bindTo(device: NIONetworkDevice, on channel: Channel) -> EventLoopFuture<Void> {
23+
internal func bindTo(_ device: NIONetworkDevice, on channel: Channel) -> EventLoopFuture<Void> {
2424
#if canImport(Darwin)
2525
switch device.address {
2626
case .v4:

Sources/LCLWebSocket/Server/WebSocketServer.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ extension WebSocketServer {
277277
let device = findDevice(with: deviceName, protocol: resolvedAddress.protocol)
278278
{
279279
logger.debug("deviceName \(deviceName), device \(device)")
280-
return bindTo(device: device, on: channel)
280+
return bindTo(device, on: channel)
281281
}
282282

283283
return channel.eventLoop.makeSucceededVoidFuture()
@@ -310,7 +310,8 @@ extension WebSocketServer {
310310
if let deviceName = configuration.deviceName,
311311
let device = findDevice(with: deviceName, protocol: resolvedAddress.protocol)
312312
{
313-
return bindTo(device: device, on: channel)
313+
logger.debug("deviceName \(deviceName), device \(device)")
314+
return bindTo(device, on: channel)
314315
}
315316

316317
return channel.eventLoop.makeSucceededVoidFuture()

0 commit comments

Comments
 (0)