small tweaks

This commit is contained in:
Erik 2015-12-30 20:14:31 -05:00
parent 0ebe56d780
commit 7acce7d18e
2 changed files with 12 additions and 12 deletions

View File

@ -523,19 +523,19 @@ public final class SocketEngine: NSObject, SocketEngineSpec, WebSocketDelegate {
/**
Write a message, independent of transport.
*/
*/
public func write(msg: String, withType type: SocketEnginePacketType, withData data: [NSData]) {
dispatch_async(emitQueue) {
if self.connected {
if self.websocket {
DefaultSocketLogger.Logger.log("Writing ws: %@ has data: %@",
type: self.logType, args: msg, data.count != 0)
self.sendWebSocketMessage(msg, withType: type, withData: data)
} else {
DefaultSocketLogger.Logger.log("Writing poll: %@ has data: %@",
type: self.logType, args: msg, data.count != 0)
self.sendPollMessage(msg, withType: type, withData: data)
}
guard self.connected else { return }
if self.websocket {
DefaultSocketLogger.Logger.log("Writing ws: %@ has data: %@",
type: self.logType, args: msg, data.count != 0)
self.sendWebSocketMessage(msg, withType: type, withData: data)
} else {
DefaultSocketLogger.Logger.log("Writing poll: %@ has data: %@",
type: self.logType, args: msg, data.count != 0)
self.sendPollMessage(msg, withType: type, withData: data)
}
}
}

View File

@ -68,7 +68,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient {
self.socketURL = socketURL["https?://"] ~= ""
for option in options ?? [] {
for option in options {
switch option {
case .ConnectParams(let params):
connectParams = params