[Jukebox-cvs] CVS update: J4/src/java/gnu/j4/examples ServerSocketTest.java
Brought to you by:
vtt
From: CVS B. <vt...@fr...> - 2000-10-25 02:59:33
|
User: vt Date: 00/10/24 19:59:35 Modified: src/java/gnu/j4/examples ServerSocketTest.java Log: Made the test a little more readable. Probably, it's obsolete by now anyway, but it's good to keep the things neat. Revision Changes Path 1.3 +18 -1 J4/src/java/gnu/j4/examples/ServerSocketTest.java CVSWEB Options: ------------------- CVSWeb: Annotate this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/examples/ServerSocketTest.java?annotate=1.3&cvsroot=jukebox4 CVSWeb: View this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/examples/ServerSocketTest.java?rev=1.3&content-type=text/x-cvsweb-markup&cvsroot=jukebox4 CVSWeb: Diff to previous version: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/examples/ServerSocketTest.java.diff?r1=1.3&r2=1.2&cvsroot=jukebox4 ----------------------------------- Index: ServerSocketTest.java =================================================================== RCS file: /usr/local/cvs/J4/src/java/gnu/j4/examples/ServerSocketTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ServerSocketTest.java 2000/03/03 04:20:16 1.2 +++ ServerSocketTest.java 2000/10/25 02:59:34 1.3 @@ -1,5 +1,6 @@ package gnu.j4.examples; +import gnu.j4.sem.SemaphoreTimedOutException; import gnu.j4.service.ActiveService; import gnu.j4.service.ServiceUnavailableException; import gnu.j4.framework.server.net.SocketAcceptor; @@ -29,7 +30,23 @@ complain(LOG_NOTICE, LOG_SST, "Sleeping for 10 seconds..."); Thread.sleep(10000); complain(LOG_NOTICE, LOG_SST, "Trying to interrupt the acceptor..."); - acceptor.stop(); + + try { + + if ( !acceptor.stop().waitFor(2000) ) { + + complain(LOG_WARNING, LOG_SST, "Oh well. Can't stop it, it is not safe to use the socket connector on this platform."); + + } else { + + complain(LOG_NOTICE, LOG_SST, "Passed."); + removeDependant(acceptor); + } + + } catch ( SemaphoreTimedOutException stex ) { + + complain(LOG_WARNING, LOG_SST, "Timed out waiting 2 seconds for the acceptor to stop: " + stex.getMessage()); + } } protected void shutdown() throws InterruptedException { |