Package mireka.pop
Class SessionThread
- Object
-
- Thread
-
- mireka.pop.SessionThread
-
- All Implemented Interfaces:
Runnable
public class SessionThread extends ThreadSessionThread manages the TCP connection to the POP3 client and contains the loop which processes the incoming commands.
-
-
Constructor Summary
Constructors Constructor Description SessionThread(PopServer server, mireka.pop.ServerThread serverThread, java.net.Socket socket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.OutputStreamgetOutputStream()java.net.SocketgetSocket()Returns the current socket.voidquit()Triggers the shutdown of the thread and the closing of the connection.voidrun()voidsendResponse(String response)Sends the response to the clientvoidsetSocket(java.net.Socket socket)Initializes our reader, writer, and the i/o filter chains based on the specified socket.voidshutdown()-
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
-
SessionThread
public SessionThread(PopServer server, mireka.pop.ServerThread serverThread, java.net.Socket socket) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfaceRunnable- Overrides:
runin classThread
-
sendResponse
public void sendResponse(String response) throws java.io.IOExceptionSends the response to the client- Throws:
java.io.IOException
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOException- Throws:
java.io.IOException
-
shutdown
public void shutdown()
-
quit
public void quit()
Triggers the shutdown of the thread and the closing of the connection.
-
getSocket
public java.net.Socket getSocket()
Returns the current socket. This function is called when the original socket is to be wrapped by an SSLSocket, after the STLS command is received.
-
setSocket
public void setSocket(java.net.Socket socket) throws java.io.IOExceptionInitializes our reader, writer, and the i/o filter chains based on the specified socket. This is called internally when we startup and when (if) SSL is started.- Throws:
java.io.IOException
-
-