Parallel Programming WS 2014/2015 - File LicenseTest.java
public class LicenseTest { private static final int N = 8; public static void main(String[] args) { Channel reqservChan = new Channel(); Channel relservChan = new Channel(); LicenseServer serv = new LicenseServer(reqservChan, relservChan); serv.start(); LicenseClient[] clients = new LicenseClient[N]; for (int i = 0; i < N; i++) { clients[i] = new LicenseClient(reqservChan, relservChan, "User " + i); clients[i].start(); } try { Thread.sleep(10000); } catch (InterruptedException e) {} for (int i = 0; i < N; i++) { clients[i].stopIt(); } serv.stopIt(); } }
Generiert mit Camelot | Probleme mit Camelot? | Geändert am: 26.01.2015