forked from hharithaki/Voice-Conference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Peer2.java
30 lines (23 loc) · 1.08 KB
/
Peer2.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.net.InetAddress;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Peer2 {
private final static int port1 = 12345;
private final static int port2 = 8888;
public static boolean flag = false;
public final static Object lock = new Object();
public static void main(String args[]) {
if (args.length != 1) { // command line input for host(224.0.1.0)
System.out.println("usage: java DatagramClient host <224.0.1.0>");
return;
}
try {
ControlSend c = new ControlSend(InetAddress.getByName(args[0]), port1, port2); // control class to handle which user talks
c.start();
ControlReceive cc = new ControlReceive(InetAddress.getByName(args[0]), port1, port2); // control class to allow certain user to talk
cc.start();
} catch (Exception e) {
Logger.getLogger(Peer2.class.getName()).log(Level.SEVERE, null, e);
}
}
}