Just FYI, a bit more Scala-ish way to do this would be:

```scala
  import scala.util.Try
  def isPortFree(port: Int): Boolean = Try { val ss = new ServerSocket(port); ss.close() }.isSuccess
```