public abstract class AbstractUDPClient extends Thread
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
AbstractUDPClient()
Constructs an AbstractUDPClient with default parameters.
|
AbstractUDPClient(int port)
Constructs an AbstractUDPClient object given only the port number.
|
AbstractUDPClient(int port,
String hostname)
Constructs an AbstractUDPClient object given the port number and hostname.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getDescription()
Returns a description of this class.
|
abstract String |
getInitMessage()
Returns the init message for this client.
|
boolean |
isRunning()
Checks to see if the thread is running.
|
protected void |
pauseMilliseconds(int ms)
Pause the thread.
|
abstract void |
received(String msg)
Received a message.
|
void |
run()
Runs the thread.
|
void |
send(String message)
Sends a message to SServer.
|
void |
start()
Start the thread.
|
void |
stopRunning()
Stops the thread running.
|
String |
toStateString()
Returns a string containing the connection details.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
public AbstractUDPClient()
public AbstractUDPClient(int port)
port
- Any valid port.public AbstractUDPClient(int port, String hostname)
port
- Any valid port.hostname
- Any valid hostname. (eg. 192.168.1.67 or RCSServerHost)public boolean isRunning()
public void stopRunning()
public void run()
public void send(String message) throws IOException
message
- A valid SServer message.IOException
- if any.public abstract String getInitMessage()
public abstract void received(String msg) throws IOException
msg
- The message received.IOException
- if any.public String toStateString()
protected String getDescription()
protected void pauseMilliseconds(int ms)
ms
- How long to pause the thread for (in ms).Copyright © 2003–2015 Atan. All rights reserved.