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

Add code for opening ServerSocket #21

Merged
merged 2 commits into from
Feb 3, 2023
Merged

Add code for opening ServerSocket #21

merged 2 commits into from
Feb 3, 2023

Conversation

kappsegla
Copy link
Contributor

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

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.
@kappsegla kappsegla linked an issue Feb 3, 2023 that may be closed by this pull request
RehasLiamsi
RehasLiamsi previously approved these changes Feb 3, 2023
Copy link
Contributor

@RehasLiamsi RehasLiamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attempting review.

cchriss123
cchriss123 previously approved these changes Feb 3, 2023
Copy link
Contributor

@cchriss123 cchriss123 left a 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?

@kappsegla
Copy link
Contributor Author

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.
Since this issue #20 is mostly about open up a server and accepting incoming connection the actual design for reading and parsing incoming requests will be handled thru other issues like issue #8

This code will therefore be updated and removed in its current form as soon as other enhancement issues arrives.

Copy link
Contributor

@safstromo safstromo left a 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

@kappsegla kappsegla dismissed stale reviews from cchriss123 and RehasLiamsi via 8d640d7 February 3, 2023 12:07
@kappsegla kappsegla merged commit b956693 into main Feb 3, 2023
@kappsegla kappsegla deleted the 20-serversocket branch February 3, 2023 12:18
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

Successfully merging this pull request may close these issues.

ServerSocket
5 participants