package org.btcollider.cnc;

import org.btcollider.cnc.comm.CommException;
import org.btcollider.cnc.comm.CommServer;
import org.btcollider.cnc.keysrv.KeyServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Hello world!
 *
 */
public class CnC {
	final static Logger log = LoggerFactory.getLogger(CnC.class);
	
	public static final int PORT = 26765;
	// Invariant: positive long (2^63-1) must be able to hold all bits handled here
	public static final int MAX_BITS = 62;

	public static void main(String[] args) {
		KeyServer.init(19, 3, 1);
		CommServer server = new CommServer(PORT);
		try {
			server.listen();
		} catch (CommException e) {
			log.error("CommServer couldn't be started");
		} finally {
			server.stop();
		}
	}
}
