I have been using this lib and it works great, except when something unexpected happen and the lib crashes my program completely.
(For example, putting the computer to sleep, breaks the socket and panics).
I saw 6 panics in the code, and 3 of them could be simply passed up the function to the caller to be handled.
The 3 others happen inside goroutines running to send/receive data, and will need special handling from there.
Imo, there should be a way to handle these errors externally, so that we have full control over errors happening during execution.
But, changing the functions which could return an error to the user would result in an api break, and returning errors from the Rx/Tx goroutines would necessitate a new way to get them to the library user.
I would be willing to put the work for implementing those changes, but I would like inputs about the best ways to proceed.
The simplest way I see is having a callback called when an universe/socket is stopped because of an error, letting the user know of the issue and letting them reconnect.
Hello,
I have been using this lib and it works great, except when something unexpected happen and the lib crashes my program completely. (For example, putting the computer to sleep, breaks the socket and panics).
I saw 6 panics in the code, and 3 of them could be simply passed up the function to the caller to be handled. The 3 others happen inside goroutines running to send/receive data, and will need special handling from there.
Imo, there should be a way to handle these errors externally, so that we have full control over errors happening during execution. But, changing the functions which could return an error to the user would result in an api break, and returning errors from the Rx/Tx goroutines would necessitate a new way to get them to the library user.
I would be willing to put the work for implementing those changes, but I would like inputs about the best ways to proceed. The simplest way I see is having a callback called when an universe/socket is stopped because of an error, letting the user know of the issue and letting them reconnect.
Thanks for your opinions