triniwiz / nativescript-socketio

Socket.IO for nativescript
Apache License 2.0
71 stars 31 forks source link

Is there a way to handle socket connect error? #96

Open FranciZ opened 4 years ago

FranciZ commented 4 years ago
this.socketIO = new SocketIO(this.server);
this.socketIO.connect();

this.socketIO.once('connect', () => {
    console.log('Socket connected');
});

Is there an equivalent error event or some other way to handle an error when connecting? I'm aware about disconnect but that only triggers if the server has already been connected.