File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
docker-controller-scala-core/src/main/scala/com/github/j5ik2o/dockerController Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import java.nio.channels.ServerSocketChannel
55
66trait RandomPortUtil {
77
8- def temporaryServerAddress (interface : String = " 127.0.0.1" ): InetSocketAddress = synchronized {
8+ def temporaryServerAddress (interface : String = " 127.0.0.1" ): InetSocketAddress = RandomPortUtil . synchronized {
99 val serverSocket = ServerSocketChannel .open()
1010 try {
1111 serverSocket.socket.bind(new InetSocketAddress (interface, 0 ))
@@ -14,7 +14,7 @@ trait RandomPortUtil {
1414 } finally serverSocket.close()
1515 }
1616
17- def temporaryServerHostnameAndPort (interface : String = " 127.0.0.1" ): (String , Int ) = synchronized {
17+ def temporaryServerHostnameAndPort (interface : String = " 127.0.0.1" ): (String , Int ) = RandomPortUtil . synchronized {
1818 val socketAddress = temporaryServerAddress(interface)
1919 socketAddress.getHostName -> socketAddress.getPort
2020 }
You can’t perform that action at this time.
0 commit comments