import java.net._ import java.io._ import scala.io._ object BattleshipsClient extends App { val s = new Socket(InetAddress.getByName("localhost"), 8000) lazy val in = new BufferedSource(s.getInputStream()).getLines() val out = new PrintStream(s.getOutputStream()) out.println("0,1") out.flush() println("Received: " + in.next()) s.close() }