nuclearace / Socket.IO-Client-Swift

socket.io-client for Swift
Other
361 stars 53 forks source link

on("error") not called #103

Closed glassw closed 8 years ago

glassw commented 8 years ago

I'm using the Swift client together with a Node.js socket.io server. On the server, I authenticate the user based on handshake data. When this fails, the server invokes:

io.use(function(socket, next) { next(new Error('Not authorized'));
}

In the socket.io Web client, this triggers the on("error") callback. However, in the Swift version it does not. By debugging the library, I notice that the error message is received (type 4), yet not dispatched to the on("error") callback. Maybe because "error" events are treated as internal messages?

nuclearace commented 8 years ago

Should be fixed in v5.2.3

glassw commented 8 years ago

Confirmed, thanks