forked from vapor/websocket-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support to bind to a specific device (#1)
- Loading branch information
Showing
4 changed files
with
86 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Foundation | ||
import NIOCore | ||
|
||
extension ChannelOption where Self == ChannelOptions.Types.SocketOption { | ||
public static func ipv6Option(_ name: NIOBSDSocket.Option) -> Self { | ||
.init(level: .ipv6, name: name) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Foundation | ||
import NIOCore | ||
|
||
extension NIOBSDSocket.Option { | ||
#if canImport(Darwin) | ||
public static let ip_bound_if: NIOBSDSocket.Option = Self(rawValue: IP_BOUND_IF) | ||
public static let ipv6_bound_if: NIOBSDSocket.Option = Self(rawValue: IPV6_BOUND_IF) | ||
#elseif canImport(Glibc) | ||
public static let so_bindtodevice = Self(rawValue: SO_BINDTODEVICE) | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters