maidsafe-archive / MaidSafe-RUDP

Implementation of Reliable UDP
Other
95 stars 51 forks source link

Maid 183 cant bind on bootstrap #28

Closed inetic closed 9 years ago

inetic commented 9 years ago

Ok, so the other issue wasn't related to the MAID172 at the end. The real issue was that sometimes the ConnectionManager started two Connections to one endpoint at the same time: once from ConnectionManager::Connect and once from ConnectionManager::HandlePingFrom. These two connections were then interfering with each other resulting in undefined behavior.

What this pull request does, it makes the ConnectionManager remember to which endpoints we're currently connecting to prevent another connection being created at the same time. It has one deficiency, that is, if the Connection fails, it won't let the ConnectionManager know about that fact so all subsequent attempts to connect to the same endpoint will fail. I'll continue working on it, but in the mean time, this makes the tests go green, so I created this pull request.