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

fix: Reduce max random port on iOS #2402

Merged
merged 1 commit into from
Apr 3, 2024
Merged

fix: Reduce max random port on iOS #2402

merged 1 commit into from
Apr 3, 2024

Conversation

leblowl
Copy link

@leblowl leblowl commented Apr 2, 2024

I received an error Fatal error: Range requires lowerBound <= upperBound referencing the FindFreePort.getFirstStartingFrom method... apparently the port parameter for that function needs to be less than or equal to 65000.

Can see the source code here:

@objc(FindFreePort)
class FindFreePort: NSObject {

    @objc
    func getFirstStartingFrom(port: in_port_t) -> UInt16 {
      var returned = port;
      for i in port..<65000 {
        let (result, _) = checkPort(port: port)
        if result == true {
            returned = i;
            break;
        }
      }
      return UInt16(returned)
    }

Pull Request Checklist

  • I have linked this PR to a related GitHub issue.
  • I have added a description of the change (and Github issue number, if any) to the root CHANGELOG.md.

(Optional) Mobile checklist

Please ensure you completed the following checks if you did any changes to the mobile package:

  • I have run e2e tests for mobile
  • I have updated base screenshots for visual regression tests

I received an error `Fatal error: Range requires lowerBound <=
upperBound` referencing the `FindFreePort.getFirstStartingFrom`
method... apparently the port parameter for that function needs to be
less than or equal to 65000.
@leblowl leblowl requested a review from siepra April 2, 2024 21:30
@leblowl leblowl merged commit 2c783aa into develop Apr 3, 2024
9 of 11 checks passed
leblowl pushed a commit that referenced this pull request Apr 3, 2024
I received an error `Fatal error: Range requires lowerBound <=
upperBound` referencing the `FindFreePort.getFirstStartingFrom`
method... apparently the port parameter for that function needs to be
less than or equal to 65000.
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.

2 participants