Advertisement
Guest User

Metehan Ozten

a guest
May 28th, 2010
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. import java.net.*;
  2. import java.io.*;
  3.  
  4. public class Server {
  5.     public static void main(String[] args) throws IOException {
  6.         ServerSocket serverSocket = null;
  7.         boolean listening = true;
  8.  
  9.         try {
  10.             serverSocket = new ServerSocket(4444);
  11.         } catch (IOException e) {
  12.             System.err.println("Could not listen on port: 4444.");
  13.             System.exit(-1);
  14.         }
  15.  
  16.         while (listening)
  17.         new ServerThread(serverSocket.accept()).start();
  18.  
  19.         serverSocket.close();
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement