You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by "Jochen Wiedmann (JIRA)" <xm...@ws.apache.org> on 2006/05/07 23:00:23 UTC

[jira] Geschlossen: (XMLRPC-23) shutdown uses join with listener

     [ http://issues.apache.org/jira/browse/XMLRPC-23?page=all ]
     
Jochen Wiedmann closed XMLRPC-23:
---------------------------------

    Resolution: Won't Fix
     Assign To:     (was: rpc-dev mailing list)

The issue has seen no activity in more than three years. Consequently, I am now closing it. Please reopen, if required.


> shutdown uses join with listener
> --------------------------------
>
>          Key: XMLRPC-23
>          URL: http://issues.apache.org/jira/browse/XMLRPC-23
>      Project: XML-RPC
>         Type: Bug

>   Components: Source
>     Versions: unspecified
>  Environment: Operating System: Linux
> Platform: All
>     Reporter: Tomoyuki Kosimizu

>
> "ant test" failed with message, "Address already in use". Because
> WebServer#shutdown doesn't wait for the interrupted thread. 
> --- ClientServerRpcTest.java	2002/12/19 07:13:01	1.1
> +++ ClientServerRpcTest.java	2002/12/19 08:39:02
> @@ -171,6 +171,7 @@
>              System.out.println("Starting WebServer for url space " +
>                                 serverURL + " ...");
>              webServer = new WebServer(SERVER_PORT, localhost);
> +	    webServer.addHandler(HANDLER_NAME, new TestHandler());
>          }
>          catch (Exception e)
>          {
> @@ -203,7 +204,7 @@
>          client = null;
>          // TODO: Shut down server
>          server = null;
> -        webServer.shutdown();
> +        webServer.shutdown(true);
>          webServer = null;
>          XmlRpc.setDebug(false);
>      }
> --- WebServer.java	2002/12/19 07:01:27	1.1
> +++ WebServer.java	2002/12/19 08:38:04
> @@ -363,12 +363,28 @@
>        */
>      public void shutdown()
>      {
> +	shutdown(false);
> +    }
> +
> +    public void shutdown(boolean wait)
> +    {
>          // Stop accepting client connections
>          if (listener != null)
>          {
>              Thread l = listener;
>              listener = null;
>              l.interrupt ();
> +	    if (wait)
> +	    {
> +		try
> +		{
> +		    l.join();
> +		}
> +		catch (InterruptedException e)
> +		{
> +		    throw new RuntimeException(e.getMessage());
> +		}
> +	    }
>          }
>  
>          // Shutdown our Runner-based threads

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira