Skip to content
Snippets Groups Projects
Commit af360452 authored by SeeBasTStick's avatar SeeBasTStick
Browse files

added dynamic port allocation

parent e2640e5c
Branches
No related tags found
No related merge requests found
...@@ -9,8 +9,9 @@ import java.util.concurrent.Future ...@@ -9,8 +9,9 @@ import java.util.concurrent.Future
fun main() { fun main() {
println("opening connection and waiting ...") val socket = ServerSocket(0)
val socket = ServerSocket(55556)
println("<${socket.localPort}> is the port; opening connection and listening")
val channel = socket.accept() val channel = socket.accept()
println("accepted connection from ${channel.inetAddress}") println("accepted connection from ${channel.inetAddress}")
startServer(channel.getInputStream(), channel.getOutputStream()) startServer(channel.getInputStream(), channel.getOutputStream())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment