[ 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 13:07
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: Open
Resolution: None
Priority: 5
Submitted By: Bruce Lowery (brulow)
Assigned to: Nobody/Anonymous (nobody)
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, &#039;alive&#039;, to false and then opening a
client socket connection to the server socket.  The
logic in the loop checks the &#039;alive&#039; flag and exits the
loop if it is false.

However, the new client socket isn&#039;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;
}




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

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: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
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.