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