gumbo.net
Class ServerThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--gumbo.net.NetThread
              |
              +--gumbo.net.msg.MessageThread
                    |
                    +--gumbo.net.ServerThread
All Implemented Interfaces:
java.lang.Runnable

public class ServerThread
extends MessageThread

Base class for network application server threads capable of handling a single client connection at a time.

Note that only one client should be allowed to connect at a time, with all others being rejected. At least in Windows, however, a "zero backlog" for the ServerSocket allows a second client to connect and queue for an accept.

Version:
$Revision: 1.10 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Field Summary
protected  int _port
           
 
Fields inherited from class gumbo.net.NetThread
DEFAULT_PROXY_HOST, DEFAULT_PROXY_PORT, DEFAULT_SERVER_HOST, DEFAULT_SERVER_PORT
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerThread(java.lang.String appName, int port)
           
 
Method Summary
 boolean isServerThread()
          Returns true if this thread is a server.
 void run()
           
 
Methods inherited from class gumbo.net.msg.MessageThread
closeMessageReader, closeMessageWriter, getMessageReader, getMessageRouter, getMessageWriter, implPleaseStop, newMessageReader, newMessageWriter, setMessageReader, setMessageWriter, showPingStatus
 
Methods inherited from class gumbo.net.NetThread
addNetThreadListener, autoRetryDelay, closeClientSocket, closeServerSocket, connectionReport, fireSocketConnect, fireSocketDisconnect, fireSocketFailure, fireThreadDone, fireThreadReady, getAppName, getAutoRetryDelay, getClientSocket, getDialogParent, getServerSocket, isStopping, pleaseStop, removeNetThreadListener, requestManualRetry, setAutoRetryDelay, setClientSocket, setDialogParent, setServerSocket, showRetryConnection, showRetryServer, socketReader, socketWriter, toHost, toHostport, toHostport, toHostport, toLocalHostport, toPort, toRemoteHostport, toServerHostport
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_port

protected int _port
Constructor Detail

ServerThread

public ServerThread(java.lang.String appName,
                    int port)
Parameters:
appName - Name of the app associated with this thread (for status messages). If null, a default is used.
port - Server port number.
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

isServerThread

public boolean isServerThread()
Description copied from class: NetThread
Returns true if this thread is a server.

Specified by:
isServerThread in class NetThread