jmri.web.miniserver
Class ThreadedMiniServer
java.lang.Object
jmri.web.miniserver.NetworkServer
jmri.web.miniserver.MiniServer
jmri.web.miniserver.ThreadedMiniServer
- All Implemented Interfaces:
- Runnable
public class ThreadedMiniServer
- extends MiniServer
- implements Runnable
A multithreaded variation of MiniServer.
Adapted with permission Core Web Programming from
Prentice Hall and Sun Microsystems Press,
http://www.corewebprogramming.com/.
© 2001 Marty Hall and Larry Brown;
may be freely used or adapted.
- Author:
- Modifications by Bob Jacobsen Copyright 2005, 2006, 2009, 2010
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadedMiniServer
public ThreadedMiniServer(int port,
int connections)
handleConnection
public void handleConnection(Socket server)
- The new version of handleConnection starts a thread. This
new thread will call back to the old version of
handleConnection, resulting in the same server behavior
in a multithreaded version. The thread stores the Socket
instance since run doesn't take any arguments, and since
storing the socket in an instance variable risks having
it overwritten if the next thread starts before the run
method gets a chance to copy the socket reference.
- Overrides:
handleConnection in class MiniServer
run
public void run()
- Specified by:
run in interface Runnable
Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.
Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: