Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.net.*;
- import java.io.*;
- public class Server {
- public static void main(String[] args) throws IOException {
- ServerSocket serverSocket = null;
- boolean listening = true;
- try {
- serverSocket = new ServerSocket(4444);
- } catch (IOException e) {
- System.err.println("Could not listen on port: 4444.");
- System.exit(-1);
- }
- while (listening)
- new ServerThread(serverSocket.accept()).start();
- serverSocket.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement