commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1130599 - in /commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net: AbstractSocketAddress.java SocketAddress.java
Date Thu, 02 Jun 2011 15:15:05 GMT
Author: mturk
Date: Thu Jun  2 15:15:05 2011
New Revision: 1130599

URL: http://svn.apache.org/viewvc?rev=1130599&view=rev
Log:
add a private constructor for know address family

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractSocketAddress.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddress.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractSocketAddress.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractSocketAddress.java?rev=1130599&r1=1130598&r2=1130599&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractSocketAddress.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/AbstractSocketAddress.java
Thu Jun  2 15:15:05 2011
@@ -48,7 +48,9 @@ final class AbstractSocketAddress extend
 
         
     /**
-     * Default constructor
+     * Default constructor.
+     * The family is deducted from the content of
+     * sockaddr.
      */
     public AbstractSocketAddress(byte[] sockaddr)
     {
@@ -64,6 +66,16 @@ final class AbstractSocketAddress extend
         super(family);
     }
 
+    /**
+     * Create a new socket address with given family and
+     * binary address.
+     */
+    public AbstractSocketAddress(AddressFamily family, byte[] sockaddr)
+        throws NetworkException, InvalidArgumentException
+    {
+        super(family, sockaddr);
+    }
+
     public static byte[] getnameinfo(AddressFamily family, String hostname, String servname,
int port)
         throws OutOfMemoryError, NetworkException
     {

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddress.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddress.java?rev=1130599&r1=1130598&r2=1130599&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddress.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/SocketAddress.java
Thu Jun  2 15:15:05 2011
@@ -79,6 +79,17 @@ public abstract class SocketAddress exte
     }
 
     /**
+     * Creates an new object
+     * @param family indicates a protocl family accepted.
+     * @param sockaddr binary socket address.
+     */
+    protected SocketAddress(AddressFamily family, byte[] sockaddr)
+    {
+        super(family);
+        super.sa = sockaddr;
+    }
+
+    /**
      * Gets the hostname of this socket.
      * <p>
      * The methods does not resolve the host name. If the address was



Mime
View raw message