mirror of
https://github.com/apple/swift-nio
synced 2026-11-29 05:24:21 +00:00
Make parameter naming between connect / bind consistent.
Motivation: We should have consistent parameter naming. Modifications: Use to path: everywhere. Result: Consistent naming.
This commit is contained in:
1 parent
e3ea0d7f5d
commit
18a8467dfe
4 files changed
+9
-9
No files matched your search
@@ -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<Channel> {
|
||||
/// - 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<Channel> {
|
||||
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<Channel>` to deliver the `Channel` when connected.
|
||||
public func connect(to unixDomainSocket: String) -> EventLoopFuture<Channel> {
|
||||
public func connect(to path: String) -> EventLoopFuture<Channel> {
|
||||
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)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user