Scala : Explicit socket handling