-
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.
- Loading branch information
Dr. Brandon Wiley
committed
Jan 11, 2018
1 parent
4c5ffad
commit 1bfcf07
Showing
2 changed files
with
35 additions
and
10 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
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,32 @@ | ||
// | ||
// UDPSession.swift | ||
// Transport | ||
// | ||
// Created by Brandon Wiley on 1/11/18. | ||
// | ||
|
||
import Foundation | ||
import NetworkExtension | ||
|
||
extension NWUDPSession: UDPSession {} | ||
|
||
public protocol UDPSession { | ||
var state: NWUDPSessionState { get } | ||
var isViable: Bool { get } | ||
|
||
var resolvedEndpoint: NWEndpoint? { get } | ||
func tryNextResolvedEndpoint() | ||
|
||
func setReadHandler(_ handler: @escaping ([Data]?, Error?) -> Void, | ||
maxDatagrams: Int) | ||
func writeDatagram(_ datagram: Data, | ||
completionHandler: @escaping (Error?) -> Void) | ||
func writeMultipleDatagrams(_ datagramArray: [Data], | ||
completionHandler: @escaping (Error?) -> Void) | ||
var maximumDatagramLength: Int { get } | ||
|
||
func cancel() | ||
|
||
var hasBetterPath: Bool { get } | ||
init(upgradeFor session: NWUDPSession) | ||
} |