hyperledger-labs / Scorex

Scorex 2.0 Core
Apache License 2.0
543 stars 115 forks source link

Logic for closing connection reworked #381

Closed kushti closed 3 years ago

kushti commented 3 years ago

In this PR closing logic reworked.

Before, on getting "close" command, a peer tried to write buffered messages into the wire with ACK being awaited for each message, and then tried to close connection with waiting for confirmation from the peer again. So connection is not being closed effectively when the connectivity is lost or peer does not really want to break the connection.

This PR is about aborting the connection without waiting for anything.

Also , some minor improvements in the networking code introduced.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 46.984% when pulling 3ca42933c754022d7c2e3c70393588c80b46c9ad on discovery-improvs into e132359ac82eb7dbf2ec1d03111ce0e280bda7b3 on master.