fix binary ack
This commit is contained in:
parent
216d8cae1e
commit
308983c6c7
@ -97,18 +97,18 @@ class SocketEvent {
|
||||
return self.completeMessage(msg, args: args)
|
||||
|
||||
} else {
|
||||
msg = "43\(nsp)["
|
||||
msg = "43/\(nsp),\(ack)["
|
||||
|
||||
return self.completeMessage(msg, args: args)
|
||||
}
|
||||
} else {
|
||||
if nsp == "/" {
|
||||
msg = "46\(binary)-\(ack)[\"\(event)\""
|
||||
msg = "46\(binary)-\(ack)["
|
||||
|
||||
return self.completeMessage(msg, args: args)
|
||||
|
||||
} else {
|
||||
msg = "46\(binary)-\(nsp),\(ack)[\"\(event)\""
|
||||
msg = "46\(binary)-/\(nsp),\(ack)["
|
||||
|
||||
return self.completeMessage(msg, args: args)
|
||||
}
|
||||
|
||||
@ -182,17 +182,21 @@ class SocketIOClient: NSObject, SRWebSocketDelegate {
|
||||
|
||||
if !hasBinary {
|
||||
if self?.nsp == nil {
|
||||
str = SocketEvent.createAck(ack, withEvent: event, withArgs: items, withAckType: 3, withNsp: "/")
|
||||
str = SocketEvent.createAck(ack, withEvent: event, withArgs: items,
|
||||
withAckType: 3, withNsp: "/")
|
||||
} else {
|
||||
str = SocketEvent.createAck(ack, withEvent: event, withArgs: items, withAckType: 3, withNsp: self!.nsp!)
|
||||
str = SocketEvent.createAck(ack, withEvent: event, withArgs: items,
|
||||
withAckType: 3, withNsp: self!.nsp!)
|
||||
}
|
||||
|
||||
self?.io?.send(str)
|
||||
} else {
|
||||
if self?.nsp == nil {
|
||||
str = SocketEvent.createAck(ack, withEvent: event, withArgs: items, withAckType: 6, withNsp: "/")
|
||||
str = SocketEvent.createAck(ack, withEvent: event, withArgs: items,
|
||||
withAckType: 6, withNsp: "/", withBinary: emitDatas.count)
|
||||
} else {
|
||||
str = SocketEvent.createAck(ack, withEvent: event, withArgs: items, withAckType: 6, withNsp: self!.nsp!)
|
||||
str = SocketEvent.createAck(ack, withEvent: event, withArgs: items,
|
||||
withAckType: 6, withNsp: self!.nsp!, withBinary: emitDatas.count)
|
||||
}
|
||||
|
||||
self?.io?.send(str)
|
||||
@ -603,7 +607,7 @@ class SocketIOClient: NSObject, SRWebSocketDelegate {
|
||||
~= "\"~~$2\""
|
||||
|
||||
let mes:SocketEvent
|
||||
if ackNum != "" {
|
||||
if ackNum == "" {
|
||||
mes = SocketEvent(event: event, args: placeholdersRemoved,
|
||||
placeholders: numberOfPlaceholders.toInt()!)
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user