Determine temporary ports with SocketUtils #23337
This commit is contained in:
parent
32af30ee0a
commit
1852649d0d
1 changed files with 2 additions and 4 deletions
|
|
@ -66,10 +66,8 @@ object Configuration {
|
|||
provider: Option[ConfigSSLEngineProvider])
|
||||
|
||||
def getCipherConfig(cipher: String, enabled: String*): CipherConfig = {
|
||||
val localPort, remotePort = {
|
||||
val s = new java.net.ServerSocket(0);
|
||||
try s.getLocalPort
|
||||
finally s.close()
|
||||
val (localPort, remotePort) = SocketUtil.temporaryServerAddresses(2, "127.0.0.1").map(_.getPort) match {
|
||||
case Seq(local, remote) => (local, remote)
|
||||
}
|
||||
try {
|
||||
//if (true) throw new IllegalArgumentException("Ticket1978*Spec isn't enabled")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue