listen
This commit is contained in:
parent
8ca4ea90f0
commit
a575c57743
|
@ -0,0 +1,21 @@
|
|||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try (ServerSocket serverSocket = new ServerSocket(8080)) {
|
||||
System.out.println("listening on socket 8080...");
|
||||
while (true) {
|
||||
try (Socket client = serverSocket.accept()) {
|
||||
handleClient(client);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void handleClient(Socket client) {
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue