make engine send internal

This commit is contained in:
Erik 2016-01-24 11:31:04 -05:00
parent adf8692234
commit bf1104443a
2 changed files with 8 additions and 11 deletions

View File

@ -459,15 +459,6 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
websocket = false
}
/// Send an engine message (4)
public func send(msg: String, withData datas: [NSData]) {
if probing {
probeWait.append((msg, .Message, datas))
} else {
write(msg, withType: .Message, withData: datas)
}
}
@objc private func sendPing() {
//Server is not responding
if pongsMissed > pongsMissedMax {
@ -514,10 +505,12 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
DefaultSocketLogger.Logger.log("Writing ws: %@ has data: %@",
type: self.logType, args: msg, data.count != 0)
self.sendWebSocketMessage(msg, withType: type, withData: data)
} else {
} else if !self.probing {
DefaultSocketLogger.Logger.log("Writing poll: %@ has data: %@",
type: self.logType, args: msg, data.count != 0)
self.sendPollMessage(msg, withType: type, withData: data)
} else {
self.probeWait.append((msg, type, data))
}
}
}

View File

@ -55,7 +55,6 @@ import Foundation
func open(opts: [String: AnyObject]?)
func parseEngineData(data: NSData)
func parseEngineMessage(message: String, fromPolling: Bool)
func send(msg: String, withData datas: [NSData])
func write(msg: String, withType type: SocketEnginePacketType, withData data: [NSData])
}
@ -74,4 +73,9 @@ extension SocketEngineSpec {
return .Right(str)
}
}
/// Send an engine message (4)
func send(msg: String, withData datas: [NSData]) {
write(msg, withType: .Message, withData: datas)
}
}