Update, notably prefixed domain to groupId.
authorRick van Rein <rick@openfortress.nl>
Thu, 27 Dec 2012 14:25:23 +0000 (15:25 +0100)
committerRick van Rein <rick@openfortress.nl>
Thu, 27 Dec 2012 14:25:23 +0000 (15:25 +0100)
pom.xml
src/main/java/nl/openfortress/socket6bed4/DatagramSocket6bed4.java
src/main/java/nl/openfortress/socket6bed4/NeighborCache.java
src/main/java/nl/openfortress/socket6bed4/ServerNode.java

diff --git a/pom.xml b/pom.xml
index 12a9e22..25df893 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -2,9 +2,9 @@
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
-  <groupId>socket6bed4</groupId>
+  <groupId>nl.openfortress.socket6bed4</groupId>
   <artifactId>nl.openfortress.socket6bed4</artifactId>
-  <version>0.0</version>
+  <version>0.2.2</version>
   <packaging>jar</packaging>
 
   <properties>
index 92dd30c..3678c4b 100644 (file)
@@ -94,6 +94,11 @@ public class DatagramSocket6bed4 extends DatagramSocket {
        throws SocketException {
                //
                // Verify if binding request is properly formed
+               if (port == 0) {
+                       // Although I did not see it specified, this C-ism is apparently used a lot
+                       bind ((InetSocketAddress) null);
+                       return;
+               }
                if ((port <= 0) || (port > 65535)) {
                        throw new SocketException ("Binding is only possible to ports from 1 to 65535");
                }
index 6e545a7..cc705ba 100644 (file)
@@ -467,6 +467,7 @@ class NeighborCache {
                        cache = owner;
                        whoami = mystate;
                        queue = new ArrayDeque <Neighbor> ();
+                       setDaemon (true);
                        this.start ();
                }
                
index ecbfe86..f3dfb55 100644 (file)
@@ -46,9 +46,9 @@ extends DatagramSocket {
        public ServerNode (InetSocketAddress isa)
        throws SocketException {
                super ();
+               tunserver = isa;
                maintainer = new Maintainer (this);
                worker = new Worker (this);
-               tunserver = isa;
                udp_clients = new BlockingQueue [65536];
        }
 
@@ -66,9 +66,9 @@ extends DatagramSocket {
        public ServerNode (InetSocketAddress isa, int port)
        throws SocketException {
                super (port);
+               tunserver = isa;
                maintainer = new Maintainer (this);
                worker = new Worker (this);
-               tunserver = isa;
                udp_clients = new BlockingQueue [65536];
        }
 
@@ -646,6 +646,7 @@ extends DatagramSocket {
                
                public Worker (ServerNode owner) {
                        this.uplink = owner;
+                       setDaemon (true);
                }
                
        }
@@ -761,6 +762,14 @@ extends DatagramSocket {
                 */
                public Maintainer (DatagramSocket uplink) {
                        this.uplink = uplink;
+                       try {
+                               byte payload[] = { };
+                               keepalive_packet = new DatagramPacket (payload, 0, tunserver);
+                       } catch (SocketException se) {
+                               System.err.println (se);
+                               keepalive_packet = null;
+                       }
+                       setDaemon (true);
                }
        }