All pastes #485879 Raw Edit

Stupid thing

public text v1 · immutable
·published 2007-05-13 09:25 UTC
rendered paste body
import java.net.*;
import java.io.*;
import java.util.*;
public class ChatServer {
  public ChatServer (int port) throws IOException {
    ServerSocket server = new ServerSocket (port);
    while (true) {
      Socket client = server.accept ();
      System.out.println ("Accepted from " + client.getInetAddress ());
      ChatHandler c = new ChatHandler (client);
      c.start ();
    }
  }
public static void main (String args[]) throws IOException {
    if (args.length != 1)
      throw new RuntimeException ("Syntax: ChatServer 1325");
    new ChatServer (Integer.parseInt (args[0]));
  }
}