Peers now transmit their role before sending file#13
Open
BrunoFreitasgit wants to merge 4 commits intopsantosl:masterfrom
Open
Peers now transmit their role before sending file#13BrunoFreitasgit wants to merge 4 commits intopsantosl:masterfrom
BrunoFreitasgit wants to merge 4 commits intopsantosl:masterfrom
Conversation
knocte
reviewed
Feb 2, 2021
Program.cs
Outdated
| class Program | ||
| { | ||
| public static string ReceiverRole = "receiver"; | ||
| public static string SenderRole = "sender"; |
Contributor
There was a problem hiding this comment.
let's rather use an enum? and then use .ToString()
knocte
reviewed
Feb 5, 2021
Program.cs
Outdated
| static int SleepTime(DateTime now) | ||
| { | ||
| List<int> seconds = new List<int>() {10, 20, 30, 40, 50, 60}; | ||
| List<int> seconds = new List<int>() { 10, 20, 30, 40, 50, 60 }; |
Contributor
There was a problem hiding this comment.
let's try to remove hunks that are unrelated
knocte
reviewed
Feb 5, 2021
| if (role == myRole.ToString()) | ||
| { | ||
| Console.Error.WriteLine("Peers can't have the same role."); | ||
| return; |
Contributor
There was a problem hiding this comment.
if you exit the function like this, this won't translate into a non-zero exitcode for the program
Author
There was a problem hiding this comment.
What do you suggest instead?
Contributor
There was a problem hiding this comment.
call directly Environment.Exit? I know it doesn't seem very clean, but it would be more correct.
Contributor
|
@psantosl can you review/merge? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #12 by transmitting roles before file transfer.