[ mx4j-Bugs-931214 ] HttpAdaptor doesn't stop cleanly

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Bugs item #931214, was opened at 2004-04-07 14:07
Message generated for change (Comment added) made by btscully
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=931214&group_id=47745

Category: HTTP Adaptor
Group: Release 2.0.1
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Bruce Lowery (brulow)
>Assigned to: Brian Scully (btscully)
Summary: HttpAdaptor doesn't stop cleanly

Initial Comment:
The HttpAdaptor stop method triggers the client
connection accept loop to exit by setting a boolean
state variable, 'alive', to false and then opening a
client socket connection to the server socket.  The
logic in the loop checks the 'alive' flag and exits the
loop if it is false.

However, the new client socket isn't closed
immediately, so in an application that stops a
HttpAdaptor and then creates a new one soon after, the
new server socket may not be able to bind to the port
since the previous client socket may not yet have been
cleaned up.

The client socket just needs to be closed before the
loop is exited.


client = serverSocket.accept();
if (!alive)
{
    client.close(); // <----
    break;
}




----------------------------------------------------------------------

>Comment By: Brian Scully (btscully)
Date: 2004-06-13 17:50

Message:
Logged In: YES 
user_id=234750

I have applied this patch.  Thanks for the submission.  I
agree this is the right way to do things, but I have not
been able to duplicate your particular problem.  Every time
I stop the HTTPAdaptor, I can immediately reopen it with no
"port already bound" error.  The fix is available in CVS HEAD.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=931214&group_id=47745


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.