@@ -131,8 +131,7 @@ public final class SocketEngine: NSObject, SocketEngineSpec, WebSocketDelegate {
131
131
132
132
return . Left( mutData)
133
133
} else {
134
- let str = " b4 " + data. base64EncodedStringWithOptions (
135
- NSDataBase64EncodingOptions . Encoding64CharacterLineLength)
134
+ let str = " b4 " + data. base64EncodedStringWithOptions ( . Encoding64CharacterLineLength)
136
135
137
136
return . Right( str)
138
137
}
@@ -456,7 +455,7 @@ public final class SocketEngine: NSObject, SocketEngineSpec, WebSocketDelegate {
456
455
457
456
// Polling methods
458
457
extension SocketEngine {
459
- func doPoll( ) {
458
+ private func doPoll( ) {
460
459
if websocket || waitingForPoll || !connected || closed {
461
460
return
462
461
}
@@ -478,7 +477,7 @@ extension SocketEngine {
478
477
doLongPoll ( req)
479
478
}
480
479
481
- func doRequest( req: NSMutableURLRequest ,
480
+ private func doRequest( req: NSMutableURLRequest ,
482
481
withCallback callback: ( NSData ? , NSURLResponse ? , NSError ? ) -> Void ) {
483
482
if !polling || closed || invalidated {
484
483
return
@@ -490,7 +489,7 @@ extension SocketEngine {
490
489
session. dataTaskWithRequest ( req, completionHandler: callback) . resume ( )
491
490
}
492
491
493
- func doLongPoll( req: NSMutableURLRequest ) {
492
+ private func doLongPoll( req: NSMutableURLRequest ) {
494
493
doRequest ( req) { [ weak self] data, res, err in
495
494
if let this = self {
496
495
if err != nil || data == nil {
@@ -521,7 +520,7 @@ extension SocketEngine {
521
520
}
522
521
}
523
522
524
- func flushWaitingForPost( ) {
523
+ private func flushWaitingForPost( ) {
525
524
if postWait. count == 0 || !connected {
526
525
return
527
526
} else if websocket {
@@ -583,7 +582,7 @@ extension SocketEngine {
583
582
584
583
// We had packets waiting for send when we upgraded
585
584
// Send them raw
586
- func flushWaitingForPostToWebSocket( ) {
585
+ private func flushWaitingForPostToWebSocket( ) {
587
586
guard let ws = self . ws else { return }
588
587
589
588
for msg in postWait {
@@ -618,7 +617,7 @@ extension SocketEngine {
618
617
619
618
/// Send polling message.
620
619
/// Only call on emitQueue
621
- func sendPollMessage( var msg: String , withType type: SocketEnginePacketType ,
620
+ private func sendPollMessage( var msg: String , withType type: SocketEnginePacketType ,
622
621
datas: [ NSData ] ? = nil ) {
623
622
Logger . log ( " Sending poll: %@ as type: %@ " , type: logType, args: msg, type. rawValue)
624
623
@@ -638,7 +637,7 @@ extension SocketEngine {
638
637
}
639
638
}
640
639
641
- func stopPolling( ) {
640
+ private func stopPolling( ) {
642
641
invalidated = true
643
642
session. finishTasksAndInvalidate ( )
644
643
}
0 commit comments