private static void shutdownCoSimulation() throws InterruptedException { if (server != null) { server.close(); } if (client != null) { Console.out.println("Waiting for client to recieve disconnect instructions..."); try { client.join(); } catch (InterruptedException e) { // ignore } try { Console.out.println("Client instructed to disconnect so disconnecting now"); client.disconnect(); } catch (Exception e) { // don't care } } }