-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add code for opening ServerSocket #21
Conversation
Creates a server socket object in main method and accepts client connections. Some example code for reading and writing to the client is also included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attempting review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of repeated code with the print lines. It is very unclear why there is 7 of them. Perhaps there is some better way of handling that like a logger or a loop?
Completely agree on this. Reading input should probably be done in it's own method and depending on the first line we can get a count for how many more lines should be available for reading and doing that in a loop. This code will therefore be updated and removed in its current form as soon as other enhancement issues arrives. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a new line at the end of the file.
A new line at the end of the file is terminating. Not having this will cause problems for some tools.
Having a newline at the end of the file allows files to be concatenated. If you miss the newline then when you concatenate files, the first line of the second file will be placed at the end of the last line of the first file, on the same line.
More info here
8d640d7
Creates a server socket object in main method and accepts client connections. Some example code for reading and writing to the client is also included.
Fixes #20