int port = Integer.parseInt( args[0] );
ServerSocket server = new ServerSocket( port );
Socket client = server.accept();
BufferedReader in = new BufferedReader(
new InputStreamReader( client.getInputStream() ) );
String line;
while ( (line = in.readLine() ) != null )
System.out.println( line );