SocketUtils is internalized. The library has been changed.#4
SocketUtils is internalized. The library has been changed.#4fennec-fox wants to merge 2 commits intoasarkar:masterfrom
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.
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.
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.
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.
@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