Skip to content
Snippets Groups Projects
Commit cd0eb9df authored by Hoai Viet Nguyen's avatar Hoai Viet Nguyen
Browse files

remove unused exectuor

parent 68726c0f
No related branches found
No related tags found
No related merge requests found
......@@ -6,14 +6,13 @@ import java.net.InetSocketAddress
fun main(args: Array<String>) {
val server = HttpServer.create(InetSocketAddress(8000), 0)
server.createContext("/", MyHandler())
server.executor = null // creates a default executor
server.start()
println("Server listing on port 8000")
}
class MyHandler : HttpHandler {
override fun handle(httpExchange: HttpExchange) {
val payload = "This is the payload 1"
val payload = "This is the payload"
httpExchange.sendResponseHeaders(200, payload.length.toLong())
val os = httpExchange.responseBody
os.write(payload.toByteArray())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment