// look for -p, -d arguments
try {
Options options = new Options(args);
port = new URL(options.getURL()).getPort();
} catch (MalformedURLException ex) {
log.error("Hosed URL: "+ex);
System.exit(1);
}
try {
srvSocket = new ServerSocket(port);
} catch (IOException ex) {
log.error("Can't create server socket on port "+port);
System.exit(1);
}
log.info("TCPListener is listening on port "+port+".");