Tell users what namespace was connected to

This commit is contained in:
Erik 2017-07-04 08:29:02 -04:00
parent 1a42580826
commit 206e1eed4f
No known key found for this signature in database
GPG Key ID: 4930B7C5FBC1A69D
3 changed files with 27 additions and 27 deletions

View File

@ -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) {

View File

@ -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])

View File

@ -36,7 +36,7 @@ extension SocketParsable where Self: SocketIOClientSpec {
if packetNamespace == "/" && nsp != "/" {
joinNamespace(nsp)
} else {
didConnect()
didConnect(toNamespace: packetNamespace)
}
}