Package org.cristian.t4j
Class TelnetDefaultHandler
- java.lang.Object
-
- java.lang.Thread
-
- org.cristian.t4j.TelnetServer.Handler
-
- org.cristian.t4j.TelnetDefaultHandler
-
- All Implemented Interfaces:
java.lang.Runnable
public class TelnetDefaultHandler extends TelnetServer.Handler
This is the default telnet handler class.
-
-
Constructor Summary
Constructors Constructor Description TelnetDefaultHandler(java.net.Socket Socket, TelnetServer Service)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handle(java.io.BufferedReader STDIN, java.io.PrintWriter STDOUT)
Executes the handling code in a loop until the connection is closed.TelnetServer.Handler
newHandler(java.net.Socket Socket, TelnetServer Service)
Make a new server handler instance.-
Methods inherited from class org.cristian.t4j.TelnetServer.Handler
getNextThreadID, run, setup, terminate
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
TelnetDefaultHandler
public TelnetDefaultHandler(java.net.Socket Socket, TelnetServer Service)
-
-
Method Detail
-
newHandler
public TelnetServer.Handler newHandler(java.net.Socket Socket, TelnetServer Service)
Description copied from class:TelnetServer.Handler
Make a new server handler instance.- Specified by:
newHandler
in classTelnetServer.Handler
- Parameters:
Socket
- The connection's socket instance.Service
- The current server instance.- Returns:
- A new Handler instance.
-
handle
public void handle(java.io.BufferedReader STDIN, java.io.PrintWriter STDOUT) throws java.io.IOException
Description copied from class:TelnetServer.Handler
Executes the handling code in a loop until the connection is closed.- Specified by:
handle
in classTelnetServer.Handler
- Parameters:
STDIN
- The standard input stream.STDOUT
- The standard output stream.- Throws:
java.io.IOException
- Raised mostly from trying to write or read from STDIN/OUT when the connection has been closed.
-
-