Closed KEGustafsson closed 3 years ago
This PR has some problems:
close
method, it is destroy
https://nodejs.org/api/net.html#net_socket_destroy_errorFor closing TCP, I used end in tcp.js but that can be changed to destroy. Is UDP closing OK? At least for my testing both TCP and UDP closing are working OK.
I could add timeout to reconnecting. Is setTimeout
with test flag (connection closed on purpose) a proper way to do this? Could you point SK tcp reconnect code?
I could also add couple of lines to readme about added features.
Ooops, I think I messed up tcp and dgram sockets.
If I can I use somebody else's reconnecting code, get stuff like backoff policies out of the box and maybe less bugs out of the gate https://github.com/SignalK/signalk-server/blob/150d1221da5c8f673b0a9f5cbc2bac0df3cabd10/packages/streams/tcp.js
Could you consider these changes to be merged?