Is there a way to register an event listener to handle incoming WebSocket data?
I would like to provide specific handling for the user when the session is terminated.
Best Answer
G
Gwenaelle @MyScript
said
about 1 month ago
Dear Woongki Kim,
Thank you for your question.
If you are using iinkTS with TEXT or MATH and Websocket, there is already a mechanism in the manageErrorMessage method of the https://github.com/MyScript/iinkTS/blob/master/src/recognizer/WSRecognizer.ts object that detects the session disconnection and transmits an internal error event with the InternalEvent object. You can then add an error listener with the addErrorListener of the InternalEvent object, to listen to these internal error event. You can refer to the Editor object that already implements such a listener to detect session terminations and display the error messages with its showError method: https://github.com/MyScript/iinkTS/blob/master/src/Editor.ts#L381
If you are using iinkTS with TEXT or MATH and Websocket, there is already a mechanism in the manageErrorMessage method of the https://github.com/MyScript/iinkTS/blob/master/src/recognizer/WSRecognizer.ts object that detects the session disconnection and transmits an internal error event with the InternalEvent object. You can then add an error listener with the addErrorListener of the InternalEvent object, to listen to these internal error event. You can refer to the Editor object that already implements such a listener to detect session terminations and display the error messages with its showError method: https://github.com/MyScript/iinkTS/blob/master/src/Editor.ts#L381
Woongki Kim
Is there a way to register an event listener to handle incoming WebSocket data?
I would like to provide specific handling for the user when the session is terminated.
Dear Woongki Kim,
Thank you for your question.
If you are using iinkTS with TEXT or MATH and Websocket, there is already a mechanism in the manageErrorMessage method of the https://github.com/MyScript/iinkTS/blob/master/src/recognizer/WSRecognizer.ts object that detects the session disconnection and transmits an internal error event with the InternalEvent object.
You can then add an error listener with the addErrorListener of the InternalEvent object, to listen to these internal error event.
You can refer to the Editor object that already implements such a listener to detect session terminations and display the error messages with its showError method: https://github.com/MyScript/iinkTS/blob/master/src/Editor.ts#L381
Best regards,
Gwenaëlle
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstGwenaelle @MyScript
Dear Woongki Kim,
Thank you for your question.
If you are using iinkTS with TEXT or MATH and Websocket, there is already a mechanism in the manageErrorMessage method of the https://github.com/MyScript/iinkTS/blob/master/src/recognizer/WSRecognizer.ts object that detects the session disconnection and transmits an internal error event with the InternalEvent object.
You can then add an error listener with the addErrorListener of the InternalEvent object, to listen to these internal error event.
You can refer to the Editor object that already implements such a listener to detect session terminations and display the error messages with its showError method: https://github.com/MyScript/iinkTS/blob/master/src/Editor.ts#L381
Best regards,
Gwenaëlle
1 person likes this
Woongki Kim
thank you!