|
@@ -211,19 +211,29 @@ public class NMB extends Thread {
|
|
public void run() {
|
|
public void run() {
|
|
NBSS nbss = new NBSS();
|
|
NBSS nbss = new NBSS();
|
|
nbss.start();
|
|
nbss.start();
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ // XXX: workaround for race condition TODO: FIX FIX FIX
|
|
|
|
+ try {
|
|
|
|
+ Thread.sleep(1000);
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
+
|
|
try {
|
|
try {
|
|
/*
|
|
/*
|
|
nbnsSocket = new DatagramSocket(nbnsPort);
|
|
nbnsSocket = new DatagramSocket(nbnsPort);
|
|
nbdsSocket = new DatagramSocket(nbdsPort);
|
|
nbdsSocket = new DatagramSocket(nbdsPort);
|
|
*/
|
|
*/
|
|
- MyDatagramSocketFactory factory = new MyDatagramSocketFactory();
|
|
|
|
- nbnsSocket = factory.createDatagramSocket(nbnsPort);
|
|
|
|
- nbdsSocket = factory.createDatagramSocket(nbdsPort);
|
|
|
|
|
|
+ MyDatagramSocketFactory factory = new MyDatagramSocketFactory();
|
|
|
|
+ nbnsSocket = factory.createDatagramSocket(nbnsPort);
|
|
|
|
+ nbdsSocket = factory.createDatagramSocket(nbdsPort);
|
|
} catch (SocketException e) {
|
|
} catch (SocketException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
|
|
registrate();
|
|
registrate();
|
|
announceHost();
|
|
announceHost();
|