telnetInterface.start();
eventBus.register(telnetInterface);
- NetworkAdapter networkAcceptor = new NetworkAdapter(eventBus, core);
+ NetworkAdapter networkAcceptor = new NetworkAdapter(eventBus, core, configuration.getTelnetPort());
networkAcceptor.start();
core.start();
/** The core being controlled. */
private final Core core;
+ private final int port;
/**
* Creates a new network acceptor.
* @param eventBus
* @param core
*/
- public NetworkAdapter(EventBus eventBus, Core core) {
+ public NetworkAdapter(EventBus eventBus, Core core, int port) {
this.eventBus = eventBus;
this.core = core;
+ this.port = port;
}
@Override
protected void run() throws Exception {
- ServerSocket serverSocket = new ServerSocket(45678);
+ ServerSocket serverSocket = new ServerSocket(port);
serverSocket.setSoTimeout((int) TimeUnit.SECONDS.toMillis(1));
while (isRunning()) {
try {