package de.dhbwstuttgart.core;

import de.dhbwstuttgart.server.SocketServer;

public class JavaTXServer {

  public static boolean isRunning = false;

  final SocketServer socketServer;

  public JavaTXServer(int port) {
    this.socketServer = new SocketServer(port);
  }

  public void listen() {
    isRunning = true;
    socketServer.start();
  }

  public void forceStop() {
    try {
      socketServer.stop();
    }
    catch (InterruptedException exception) {
      System.err.println("Interrupted socketServer: " + exception);
    }
    isRunning = false;
  }


}
