0

I'm trying to handle a WS connection loss on the android system and, following the error code, try to reopen the connection, reset the client, etc...

So I actually want to test my handling process, in the Autobahn refs, I have all the possible connection loss messages in the de.tavendo.autobahn.WebSocket.ConnectionHandler reference and I would like to know how to generate those events, I know how to generate the CLOSE_CONNECTION_LOST and the CLOSE_INTERNAL_ERROR events but I don't have any idea about the 3 others (CLOSE_NORMAL seems not to happen after calling the WebSocket disconnect() method).

Is it possible?

Regards.

onizukaek
  • 1,082
  • 1
  • 14
  • 38

1 Answers1

0

You can follow the code from here to the "outside". E.g. CLOSE_INTERNAL_ERROR is triggered from here, when something fatal happens during the initial creating of background reader/writer threads.

oberstet
  • 21,353
  • 10
  • 64
  • 97
  • Thanks for your answer, I have another issue though, I don't think the jar I downloaded from the website is up to date, so I had to clone it from the github repo, created a new project from the Autobahn folder and compiled it, my apologies if it is a silly question, but how can I integrate it to my project? – onizukaek Jan 15 '14 at 09:50
  • Finally, I managed to do that in a tricky way. Thank you, there's still another question I'd like to ask, but I'll post it as a new request. – onizukaek Jan 15 '14 at 12:10