Tell users what namespace was connected to
This commit is contained in:
parent
1a42580826
commit
206e1eed4f
@ -203,12 +203,12 @@ open class SocketIOClient : NSObject, SocketIOClientSpec, SocketEngineClient, So
|
||||
return OnAckCallback(ackNumber: currentAck, items: items, socket: self)
|
||||
}
|
||||
|
||||
func didConnect() {
|
||||
func didConnect(toNamespace namespace: String) {
|
||||
DefaultSocketLogger.Logger.log("Socket connected", type: logType)
|
||||
|
||||
status = .connected
|
||||
|
||||
handleClientEvent(.connect, data: [])
|
||||
handleClientEvent(.connect, data: [namespace])
|
||||
}
|
||||
|
||||
func didDisconnect(reason: String) {
|
||||
|
||||
@ -29,7 +29,7 @@ protocol SocketIOClientSpec : class {
|
||||
var nsp: String { get set }
|
||||
var waitingPackets: [SocketPacket] { get set }
|
||||
|
||||
func didConnect()
|
||||
func didConnect(toNamespace namespace: String)
|
||||
func didDisconnect(reason: String)
|
||||
func didError(reason: String)
|
||||
func handleAck(_ ack: Int, data: [Any])
|
||||
|
||||
@ -36,7 +36,7 @@ extension SocketParsable where Self: SocketIOClientSpec {
|
||||
if packetNamespace == "/" && nsp != "/" {
|
||||
joinNamespace(nsp)
|
||||
} else {
|
||||
didConnect()
|
||||
didConnect(toNamespace: packetNamespace)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user