Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Send a message to remote peer when disconnect #1246

Merged
merged 6 commits into from Jul 20, 2019

Conversation

@TheWaWaR
Copy link
Member

commented Jul 17, 2019

  • Add a new p2p protocol StringMessageProtocol for send simple string message
  • Send a message to remote peer when disconnect

@TheWaWaR TheWaWaR requested a review from nervosnetwork/ckb-code-review as a code owner Jul 17, 2019

@nervos-bot

This comment has been minimized.

Copy link

commented Jul 17, 2019

@zhangsoledad is assigned as the chief reviewer

@u2

This comment has been minimized.

Copy link
Collaborator

commented Jul 18, 2019

What about declaring some global constants for the messages.

@doitian doitian requested review from keroro520 and jjyr Jul 18, 2019

@TheWaWaR

This comment has been minimized.

Copy link
Member Author

commented Jul 18, 2019

What about declaring some global constants for the messages.

I think it's not necessary, it's just for human read (debug purpose).

network/src/network.rs Outdated Show resolved Hide resolved
network/src/protocols/disconnect_message.rs Outdated Show resolved Hide resolved

@TheWaWaR TheWaWaR force-pushed the TheWaWaR:disconnec-message branch from 60b1fc8 to ef1a56e Jul 18, 2019

@TheWaWaR TheWaWaR force-pushed the TheWaWaR:disconnec-message branch 2 times, most recently from 3e9c953 to b6fc425 Jul 19, 2019

@jjyr
Copy link
Member

left a comment

Use more friendly msg.

network/src/network.rs Outdated Show resolved Hide resolved
network/src/network.rs Outdated Show resolved Hide resolved
network/src/network.rs Outdated Show resolved Hide resolved
network/src/network.rs Outdated Show resolved Hide resolved
network/src/network.rs Outdated Show resolved Hide resolved
network/src/network.rs Outdated Show resolved Hide resolved
sync/src/synchronizer/headers_process.rs Outdated Show resolved Hide resolved

@TheWaWaR TheWaWaR force-pushed the TheWaWaR:disconnec-message branch from 61d6e48 to 000148a Jul 19, 2019

@quake

quake approved these changes Jul 19, 2019

network/src/protocols/mod.rs Outdated Show resolved Hide resolved
@u2

u2 approved these changes Jul 19, 2019

@TheWaWaR TheWaWaR force-pushed the TheWaWaR:disconnec-message branch from d1a7abd to 32428e2 Jul 19, 2019

@jjyr

jjyr approved these changes Jul 19, 2019

@doitian doitian requested a review from keroro520 Jul 20, 2019

TheWaWaR added some commits Jul 17, 2019

@TheWaWaR TheWaWaR force-pushed the TheWaWaR:disconnec-message branch from 0536bad to 6732ac7 Jul 20, 2019

@TheWaWaR

This comment has been minimized.

Copy link
Member Author

commented Jul 20, 2019

bors r+

bors bot added a commit that referenced this pull request Jul 20, 2019

Merge #1246
1246: feat: Send a message to remote peer when disconnect r=TheWaWaR a=TheWaWaR

* Add a new p2p protocol `StringMessageProtocol` for send simple string message
* Send a message to remote peer when disconnect

Co-authored-by: Linfeng Qian <thewawar@gmail.com>
@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 20, 2019

Build succeeded

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 6732ac7 into nervosnetwork:develop Jul 20, 2019

4 of 5 checks passed

Travis CI - Pull Request Build Failed
Details
Dummy CI CI that does nothing
Details
bors Build succeeded
Details
nervosnetwork.ckb Build #20190720.26 succeeded
Details
nervosnetwork.ckb (UnitTest) UnitTest succeeded
Details
@doitian doitian referenced this pull request Jul 25, 2019

@TheWaWaR TheWaWaR deleted the TheWaWaR:disconnec-message branch Aug 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.