0

This is for Xsockets.

I have a client connected to a socket, lets say the client looses internet connection, is there a xSocket function that will get called on the client that will let me know that the client (itself) is not connected to the socket anymore?

Currently, im just getting a error:

WebSocket is already in CLOSING or CLOSED state.

I know that the socket itself knows that the client is disconnected, but how can the client know that its diconnected?

The XSockets.Events.onError and XSockets.Events.close functions are not called.

PS: Im running 3.0.3

pmeyer
  • 890
  • 7
  • 31

1 Answers1

0

The XSockets.Events.close should fire when the connection i lost ( client calls .close ) or server shutsdown the binding / subscription fires. XSockets.Events.close .

ws.bind(XSockets.Events.close, function(reason) { });

Try call .close method to validate if the event fires

ws.close()

Anyway, you have some code to share?

I also recommend you to upgrate to 3.0.6 the latest version of generation 3 of XSockets.NET . I would also concider haveing a look at generation 4.

dathor
  • 174
  • 1
  • 3