RosettaCodeData/Task/Sockets/Scala/sockets.scala
2015-02-20 00:35:01 -05:00

13 lines
284 B
Scala

import java.net.Socket
object sendSocketData {
def sendData(host: String, msg: String) {
val sock = new Socket(host, 256)
sock.getOutputStream().write(msg.getBytes())
sock.getOutputStream().flush()
sock.close()
}
sendData("localhost", "hello socket world")
}