change some methods to use nsurlrequest
This commit is contained in:
parent
2916ed0f7b
commit
361cd8fc3b
@ -568,7 +568,7 @@ extension SocketEngine {
|
|||||||
doLongPoll(req)
|
doLongPoll(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func doRequest(req: NSMutableURLRequest,
|
private func doRequest(req: NSURLRequest,
|
||||||
withCallback callback: (NSData?, NSURLResponse?, NSError?) -> Void) {
|
withCallback callback: (NSData?, NSURLResponse?, NSError?) -> Void) {
|
||||||
if !polling || closed || invalidated {
|
if !polling || closed || invalidated {
|
||||||
DefaultSocketLogger.Logger.error("Tried to do polling request when not supposed to", type: logType)
|
DefaultSocketLogger.Logger.error("Tried to do polling request when not supposed to", type: logType)
|
||||||
@ -580,7 +580,7 @@ extension SocketEngine {
|
|||||||
session?.dataTaskWithRequest(req, completionHandler: callback).resume()
|
session?.dataTaskWithRequest(req, completionHandler: callback).resume()
|
||||||
}
|
}
|
||||||
|
|
||||||
private func doLongPoll(req: NSMutableURLRequest) {
|
private func doLongPoll(req: NSURLRequest) {
|
||||||
doRequest(req) {[weak self] data, res, err in
|
doRequest(req) {[weak self] data, res, err in
|
||||||
guard let this = self else {return}
|
guard let this = self else {return}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user