try
{ sSock = new ServerSocket( port );
}
catch( IOException ioe )
{ System.out.println( "Couldn't listen on port " + port );
System.exit( -1 );
}
try
{ sock = sSock.accept();
}
catch( IOException ioe )
{ System.out.println( "Accept failed" );
System.exit( -1 );
}
try
/**/ { // ins = sock.getInputStream(); // only need output
outs = new PrintWriter( sock.getOutputStream() );
}
catch( IOException ioe )
{ System.out.println( "Failed to get I/O streams" );
System.exit( -1 );
}
try
/**/ { //int inChar = ins.read();
/*
while( inChar != -1 )
{ outs.write( inChar );
outs.flush();
System.out.print( (char)inChar );
inChar = ins.read();
}
*/
/**/ Date d = new Date();
/**/ outs.println( d.toString() );
/**/ outs.flush();
sock.close();
}
catch( IOException ioe )
{ System.out.println( "Read/write failed" );
System.exit( -1 );
}