Skip to content

Commit bf11044

Browse files
committed
make engine send internal
1 parent adf8692 commit bf11044

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

Source/SocketEngine.swift

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -458,15 +458,6 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
458458
waitingForPost = false
459459
websocket = false
460460
}
461-
462-
/// Send an engine message (4)
463-
public func send(msg: String, withData datas: [NSData]) {
464-
if probing {
465-
probeWait.append((msg, .Message, datas))
466-
} else {
467-
write(msg, withType: .Message, withData: datas)
468-
}
469-
}
470461

471462
@objc private func sendPing() {
472463
//Server is not responding
@@ -514,10 +505,12 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
514505
DefaultSocketLogger.Logger.log("Writing ws: %@ has data: %@",
515506
type: self.logType, args: msg, data.count != 0)
516507
self.sendWebSocketMessage(msg, withType: type, withData: data)
517-
} else {
508+
} else if !self.probing {
518509
DefaultSocketLogger.Logger.log("Writing poll: %@ has data: %@",
519510
type: self.logType, args: msg, data.count != 0)
520511
self.sendPollMessage(msg, withType: type, withData: data)
512+
} else {
513+
self.probeWait.append((msg, type, data))
521514
}
522515
}
523516
}

Source/SocketEngineSpec.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import Foundation
5555
func open(opts: [String: AnyObject]?)
5656
func parseEngineData(data: NSData)
5757
func parseEngineMessage(message: String, fromPolling: Bool)
58-
func send(msg: String, withData datas: [NSData])
5958
func write(msg: String, withType type: SocketEnginePacketType, withData data: [NSData])
6059
}
6160

@@ -74,4 +73,9 @@ extension SocketEngineSpec {
7473
return .Right(str)
7574
}
7675
}
76+
77+
/// Send an engine message (4)
78+
func send(msg: String, withData datas: [NSData]) {
79+
write(msg, withType: .Message, withData: datas)
80+
}
7781
}

0 commit comments

Comments
 (0)