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

32 feature handling more than one connection #33

Merged
merged 18 commits into from
Feb 8, 2024

Conversation

vonfredd
Copy link
Contributor

@vonfredd vonfredd commented Feb 6, 2024

Related Issue

Closes #32

Proposed Changes

Start a new thread when handling client connections

  • Change 1: Refactored start method in Server class and create a new thread when connection needs to be handled.
  • Change 2: ClientHandler.handleConnection now takes a socket as input parameter. The method is refactored.

@vonfredd vonfredd linked an issue Feb 6, 2024 that may be closed by this pull request
Copy link
Contributor

@Win-ther Win-ther left a comment

Choose a reason for hiding this comment

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

It looks good if you remove the while-loop in clienthandler. It might have conflicts with #24 though?

src/main/java/org/fungover/thunder/ClientHandler.java Outdated Show resolved Hide resolved
@kappsegla
Copy link
Contributor

This PR might have to make some changes after #24 is done and merged.

Win-ther
Win-ther previously approved these changes Feb 6, 2024
@Ebyrdeu Ebyrdeu mentioned this pull request Feb 6, 2024
Copy link
Contributor

@Win-ther Win-ther left a comment

Choose a reason for hiding this comment

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

The client gets disconnected after connecting because isValidConnection runs every loop and returns false after first loop, closing the socket. Other than that the code looks good.

src/main/java/org/fungover/thunder/ClientHandler.java Outdated Show resolved Hide resolved
@vonfredd
Copy link
Contributor Author

vonfredd commented Feb 7, 2024

@kappsegla Do I add the tests in this PR to cover SonarCloud expectations, or do I create an issue that creates the tests for all the old and new classes before merging this?

@Win-ther Win-ther mentioned this pull request Feb 7, 2024
@kappsegla
Copy link
Contributor

@kappsegla Do I add the tests in this PR to cover SonarCloud expectations, or do I create an issue that creates the tests for all the old and new classes before merging this?

If we can write unit tests for the code they belong to the PR. It's a needed part both for our automatic CI but also for reviewers to check and learn how the new code is expected to work from.

Copy link

sonarcloud bot commented Feb 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions

51.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@vonfredd vonfredd self-assigned this Feb 7, 2024
Copy link
Contributor

@marcusju23 marcusju23 left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

Copy link
Contributor

@Win-ther Win-ther left a comment

Choose a reason for hiding this comment

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

The code looks good and it works when I test it. Sonarclouds Quality Gate failed though, is this something we can ignore right now and merge anyway? Maybe something to look at in another issue?
I will approve right now since I want it to be able to merge if we can ignore the Qualite Gate.

@vonfredd
Copy link
Contributor Author

vonfredd commented Feb 8, 2024

The code looks good and it works when I test it. Sonarclouds Quality Gate failed though, is this something we can ignore right now and merge anyway? Maybe something to look at in another issue? I will approve right now since I want it to be able to merge if we can ignore the Qualite Gate.

The sonarcloud reacts because no old code has tests. So I also think that would be issued to fix, but ignored for now 😄 .

@kappsegla kappsegla added this pull request to the merge queue Feb 8, 2024
Merged via the queue into main with commit a386e1a Feb 8, 2024
1 of 2 checks passed
@kappsegla kappsegla deleted the 32-feature-handling-more-than-one-connection branch February 8, 2024 14:20
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.

[FEATURE] - Handling more than one connection
4 participants