import java.net.*;
import java.io.*;
import java.util.*;
public class webs14
{
	public webs14 (int port) throws IOException
	{
		ServerSocket server = new ServerSocket(port);
		while (true)
		{
			Socket client = server.accept();
			System.out.println("Accepted from " + client.getInetAddress());
			webh14 c = new webh14(client);
			c.start();
		}
	}
	public static void main(String args[]) throws IOException
	{
		if (args.length !=1)
			throw new RuntimeException ("Syntax: ChatServer <port>");
		new webs14(Integer.parseInt(args[0]));
	}
}