-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
SocketUtils is internalized. The library has been changed. #4
base: master
Are you sure you want to change the base?
Conversation
…-redis) Add Class SocketUtils.kt
Assert.isTrue(maxPort <= PORT_RANGE_MAX, "'maxPort' must be less than or equal to $PORT_RANGE_MAX") | ||
|
||
val portRange = maxPort - minPort | ||
var candidatePort: Int |
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.
I need to review this more closely, but is it possible for multiple threads to enter the do-while loop?
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.
This code is a conversion of the existing
org/springframework/util/SocketUtils.java code to Kotlin.
I have not been able to check whether it is thread safe in multithreading.
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.
@asarkar Could you please check the PR again?
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.
Thanks, but I would like to see some tests for SocketUtils. If Spring has some, feel free to use those, but otherwise, we need new tests.
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.
@asarkar The current PR was created because SocketUtils in Spring is not available.
Starting with Spring 6, SocketUtils.java used by asarkar has been removed from the code.
I will add the test code for SocketUtils mentioned above soon.
Change implementation (it.ozimov:embedded-redis > org.signal:embedded-redis)
Add Class SocketUtils.kt