diff --git a/Sources/NIO/Bootstrap.swift b/Sources/NIO/Bootstrap.swift index 392d3a431..864846c08 100644 --- a/Sources/NIO/Bootstrap.swift +++ b/Sources/NIO/Bootstrap.swift @@ -110,8 +110,8 @@ public final class ServerBootstrap { /// Bind the `ServerSocketChannel` to a UNIX Domain Socket. /// /// - parameters: - /// - path: The path of the UNIX Domain Socket to bind on. `path` must not exist, it will be created by the system. - public func bind(unixDomainSocket path: String) -> EventLoopFuture { + /// - path: The `unixDomainSocket` path to bind on. `path` must not exist, it will be created by the system. + public func bind(to path: String) -> EventLoopFuture { let evGroup = group do { let address = try SocketAddress.unixDomainSocketAddress(path: path) @@ -320,11 +320,11 @@ public final class ClientBootstrap { /// Specify the `unixDomainSocket` path to connect to for the UDS `Channel` that will be established. /// /// - parameters: - /// - address: The address to connect to. + /// - path: The `unixDomainSocket` path to connect to. /// - returns: An `EventLoopFuture` to deliver the `Channel` when connected. - public func connect(to unixDomainSocket: String) -> EventLoopFuture { + public func connect(to path: String) -> EventLoopFuture { do { - let address = try SocketAddress.unixDomainSocketAddress(path: unixDomainSocket) + let address = try SocketAddress.unixDomainSocketAddress(path: path) return connect(to: address) } catch { return group.next().newFailedFuture(error: error) diff --git a/Sources/NIOEchoServer/main.swift b/Sources/NIOEchoServer/main.swift index ee0c3b605..4a89cc820 100644 --- a/Sources/NIOEchoServer/main.swift +++ b/Sources/NIOEchoServer/main.swift @@ -96,7 +96,7 @@ let channel = try { () -> Channel in case .ip(let host, let port): return try bootstrap.bind(to: host, on: port).wait() case .unixDomainSocket(let path): - return try bootstrap.bind(unixDomainSocket: path).wait() + return try bootstrap.bind(to: path).wait() } }() diff --git a/Sources/NIOHTTP1Server/main.swift b/Sources/NIOHTTP1Server/main.swift index 4795980fb..a3ac92338 100644 --- a/Sources/NIOHTTP1Server/main.swift +++ b/Sources/NIOHTTP1Server/main.swift @@ -416,7 +416,7 @@ let channel = try { () -> Channel in case .ip(let host, let port): return try bootstrap.bind(to: host, on: port).wait() case .unixDomainSocket(let path): - return try bootstrap.bind(unixDomainSocket: path).wait() + return try bootstrap.bind(to: path).wait() } }() diff --git a/Tests/NIOTests/EchoServerClientTest.swift b/Tests/NIOTests/EchoServerClientTest.swift index ec3e0e52f..f4243ba86 100644 --- a/Tests/NIOTests/EchoServerClientTest.swift +++ b/Tests/NIOTests/EchoServerClientTest.swift @@ -125,7 +125,7 @@ class EchoServerClientTest : XCTestCase { .childChannelInitializer { channel in // Ensure we don't read faster then we can write by adding the BackPressureHandler into the pipeline. return channel.pipeline.add(handler: countingHandler) - }.bind(unixDomainSocket: udsTempDir + "/server.sock").wait() + }.bind(to: udsTempDir + "/server.sock").wait() defer { _ = serverChannel.close() @@ -168,7 +168,7 @@ class EchoServerClientTest : XCTestCase { .childChannelInitializer { channel in // Ensure we don't read faster then we can write by adding the BackPressureHandler into the pipeline. return channel.pipeline.add(handler: countingHandler) - }.bind(unixDomainSocket: udsTempDir + "/server.sock").wait() + }.bind(to: udsTempDir + "/server.sock").wait() defer { _ = serverChannel.close()