1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

Close the socket.

This commit is contained in:
Cedric Beust 2016-04-28 05:21:59 -08:00
parent f79d9f9497
commit e6a2ad98f7
2 changed files with 18 additions and 16 deletions

View file

@ -5,9 +5,10 @@ import java.io.PrintWriter
import java.net.Socket
fun main(argv: Array<String>) {
val socket = Socket("localhost", 1234)
(PrintWriter(socket.outputStream, true)).use { out ->
out.println("""{ "name" : "getDependencies", "buildFile":
"/Users/beust/kotlin/kobalt/kobalt/src/${Constants.BUILD_FILE_NAME}"}""")
Socket("localhost", 1234).use { socket ->
(PrintWriter(socket.outputStream, true)).use { out ->
out.println("""{ "name" : "getDependencies", "buildFile":
"/Users/beust/kotlin/kobalt/kobalt/src/${Constants.BUILD_FILE_NAME}"}""")
}
}
}