Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Propagate inbound socket close event on Peer to the top level P2P class - Closes #3602 #3604

Merged

Conversation

jondubois
Copy link
Contributor

What was the problem?

  • The inbound socket close event was not being emitted on top level P2P class.
  • We were removing the peer from the peer pool if the outbound socket was disconnected; this is fine for v2.0 but not suitable for v2.1 LIP protocol version since peers will no longer always be both inbound and outbound.

How did I fix it?

  • Propagated 'close' event to P2P class.
  • For connections state, use constants that are consistent with WebSocket connection states.
  • Used strings as enums for connection states for ease of debugging.
  • Only remove a peer from the PeerPool if it is disconnected both inbound and outbound.

How to test it?

Run lisk-p2p tests.

Review checklist

@shuse2 shuse2 merged commit 366d436 into feature/implement-lip-p2p May 14, 2019
@shuse2 shuse2 deleted the 3602-propagate_inbound_socket_close_event branch May 14, 2019 11:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants