|
@@ -9,6 +9,7 @@ import java.net.SocketTimeoutException;
|
|
|
import java.net.UnknownHostException;
|
|
|
|
|
|
import de.tudarmstadt.informatik.hostage.commons.HelperUtils;
|
|
|
+import de.tudarmstadt.informatik.hostage.net.MyDatagramSocketFactory;
|
|
|
|
|
|
/**
|
|
|
* NetBIOS.
|
|
@@ -211,13 +212,20 @@ public class NMB extends Thread {
|
|
|
NBSS nbss = new NBSS();
|
|
|
nbss.start();
|
|
|
try {
|
|
|
+/*
|
|
|
nbnsSocket = new DatagramSocket(nbnsPort);
|
|
|
nbdsSocket = new DatagramSocket(nbdsPort);
|
|
|
+*/
|
|
|
+ MyDatagramSocketFactory factory = new MyDatagramSocketFactory();
|
|
|
+ nbnsSocket = factory.createDatagramSocket(nbnsPort);
|
|
|
+ nbdsSocket = factory.createDatagramSocket(nbdsPort);
|
|
|
} catch (SocketException e) {
|
|
|
e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- registrate();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ registrate();
|
|
|
announceHost();
|
|
|
queryName();
|
|
|
checkForAnswers();
|