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

More functions less cases in Bittorrent.Peer.Protocol #2

Open
mpope9 opened this issue Jan 25, 2020 · 0 comments
Open

More functions less cases in Bittorrent.Peer.Protocol #2

mpope9 opened this issue Jan 25, 2020 · 0 comments

Comments

@mpope9
Copy link

mpope9 commented Jan 25, 2020

Mostly a style thing, but I think the case statements in the Protocol could be more beneficial than the case statements. It keeps indentation down.

The main reason that I am bring this up is that none of the :gen_tcp.recv function calls deal with errors being returned. If you refactored the case statements into function calls, you could easily field the :gen_tcp:recv errors in a single function call, instead of dealing with the errors in each case statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant