bpanel-org / bpanel

A Blockchain Management System, powered by bcoin
https://bpanel.org
Other
53 stars 23 forks source link

Websocket too many connections #169

Closed tynes closed 5 years ago

tynes commented 5 years ago

There are multiple places where sockets try to connect/disconnect and its hard to know if we are trying to connect when its already connected. I think that this could be one of the problems with websocket errors on the front end

connectSocket - https://github.com/bpanel-org/bpanel/blob/master/webapp/containers/App/App.js#L62 updateClient - https://github.com/bpanel-org/bpanel/blob/development/webapp/containers/App/App.js#L69 resetClient - https://github.com/bpanel-org/bpanel/blob/development/webapp/containers/App/App.js#L79

bucko13 commented 5 years ago

I'm going to close this as I don't think there is a problem with too many connections. There are a couple of unrelated issues going on though. One is we need SSL support for websockets. When working with bwallet, there was also an issue where the views were getting remounted with every update from websockets (this is patched in a current PR).

I believe all three of those areas need to be managing socket connections as they are to handle certain app updates (in particular when you change clients when the subscriptions need to be ended and restarted for the new client).