Currently the CM holds all open connections in the _connections object. There are several issues with this:
- _connections is never cleaned up (e.g. when a connection is lost or closed)
- The router also holds refs to all open DCs. This seems redundant.
We have to figure out where to store the list of open connections and which component is responsible for acting upon events (like 'close') on them. Possibilities:
- Let the CM hold refs to all open connections. If e.g. the Router needs to send data on a connection it requests this connection from the CM.
- Let the Router hold refs to all open connections. The CM then asks the Router if a connection is already open for doing maintenance (like denying subsequent offers)
- Put this logic into Peer objects.
Currently the CM holds all open connections in the _connections object. There are several issues with this:
We have to figure out where to store the list of open connections and which component is responsible for acting upon events (like 'close') on them. Possibilities: