Class StreamIoHandler

  • All Implemented Interfaces:
    IoHandler

    public abstract class StreamIoHandler
    extends IoHandlerAdapter
    A IoHandler that adapts asynchronous MINA events to stream I/O.

    Please extend this class and implement processStreamIo(IoSession, InputStream, OutputStream) to execute your stream I/O logic; please note that you must forward the process request to other thread or thread pool.

    Author:
    Apache MINA Project
    • Constructor Detail

      • StreamIoHandler

        protected StreamIoHandler()
    • Method Detail

      • processStreamIo

        protected abstract void processStreamIo​(IoSession session,
                                                InputStream in,
                                                OutputStream out)
        Implement this method to execute your stream I/O logic; please note that you must forward the process request to other thread or thread pool.
        Parameters:
        session - The current session
        in - The input stream
        out - The output stream
      • getReadTimeout

        public int getReadTimeout()
        Returns:
        read timeout in seconds. The default value is 0 (disabled).
      • setReadTimeout

        public void setReadTimeout​(int readTimeout)
        Sets read timeout in seconds. The default value is 0 (disabled).
        Parameters:
        readTimeout - The Read timeout
      • getWriteTimeout

        public int getWriteTimeout()
        Returns:
        write timeout in seconds. The default value is 0 (disabled).
      • setWriteTimeout

        public void setWriteTimeout​(int writeTimeout)
        Sets write timeout in seconds. The default value is 0 (disabled).
        Parameters:
        writeTimeout - The Write timeout