31 line
843 B
Java
31 line
843 B
Java
package liste;
|
|
|
|
//import java.util.concurrent.ExecutorService;
|
|
//import java.util.concurrent.Executors;
|
|
|
|
public class MainUDPUni {
|
|
|
|
public static void main(String[] args) {
|
|
int portServer = 2000;
|
|
|
|
|
|
UdpUnicastServer server = new UdpUnicastServer(portServer);
|
|
UdpUnicastClient client = new UdpUnicastClient(portServer, "LocalHost");
|
|
UdpUnicastClient client1 = new UdpUnicastClient(portServer, "LocalHost");
|
|
UdpUnicastClient client2 = new UdpUnicastClient(portServer, "LocalHost");
|
|
|
|
Thread ts = new Thread(server);
|
|
Thread t0 = new Thread(client);
|
|
Thread t1 = new Thread(client1);
|
|
Thread t2 = new Thread(client2);
|
|
|
|
ts.start();
|
|
t0.start();
|
|
t1.start();
|
|
t2.start();
|
|
|
|
//ExecutorService executorService = Executors.newFixedThreadPool(2);
|
|
//executorService.submit(server);
|
|
//executorService.submit(client);
|
|
}
|
|
}
|