rstudio / websocket

WebSocket client for R
https://rstudio.github.io/websocket/
Other
92 stars 18 forks source link

Return to main thread from "asio.ssl.stream:1(stream truncated)" error #80

Closed egoipse closed 3 years ago

egoipse commented 3 years ago

Hi,

WebSocket is a great package. It does exactly what it supposes to do. And I found it more user-friendly than similar modules in phyton.

Its documentation, however, is not as complete as other rstudio's packages documentation. There's no way to guess how to call a great part of WebSockets arguments, like protocols or headers. Nevertheless, step by step I made the way to solve all the issues. Except from one: I could not find a way to return to main thread after an error. As vignette states,

The I/O for a WebSocket happens on a separate thread from the main R thread; there is one thread for each WebSocket.

When I get the most common error (the asio.ssl.stream:1(stream truncated) error, code 1006), all the session gets paused, the websocket thread as well as the main thread. Basically, the entire script (or the entire set of instructions on an interactive sessión) stops to do anything. I just can't find a way to return to main thread from onError handler.

¿Any idea on how to solve this issue?

egoipse commented 3 years ago

I found what I was doing wrong. No issue here.