You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/12/03 18:40:15 UTC

DO NOT REPLY [Bug 25167] - NullPointerException in SocketClient.getRemoteAddress()

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25167>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25167

NullPointerException in SocketClient.getRemoteAddress()

dfs@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From dfs@apache.org  2003-12-03 17:40 -------
Although the suggestion appears at first to make good sense, the problem is that
SocketClient._socket_ is assigned a value by a call to connect() and afterward
only acquires a null value by a call to disconnect().  If a call to
disconnect() is not made, but the TCP connection is severed, a valid Socket
instance will remain and Socket.getInetAddress() will return null.  The
condition described by this issue report can only have arisen by an explicit
call to disconnect() and would indicate a programming error.  I am therefore 
going to mark this report invalid, but leave it open to allow the reporter 
additional time to examine his code and investigate the problem.  If there is
indeed some way to set SocketClient._socket_ to null without calling
disconnect(), then it is something we need to fix.  However, if you search
the Commons Net code for all assignments to SocketClient._socket_
(grep "_socket_ *=" $(find src/java -name *".java" -print)), you
will find the only null assignments occur in the SocketClient constructor
and in disconnect().

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org