Package jodd.http

Interface HttpConnection

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Closes connection.
      java.io.InputStream getInputStream()
      Returns connection input stream.
      java.io.OutputStream getOutputStream()
      Returns connection output stream.
      void init()
      Initializes http connection after socket is created.
      void setTimeout​(int milliseconds)
      Sets the timeout for connections, in milliseconds.
    • Method Detail

      • init

        void init()
           throws java.io.IOException
        Initializes http connection after socket is created. Applies configurations, like setTimeout(int).
        Throws:
        java.io.IOException
      • getOutputStream

        java.io.OutputStream getOutputStream()
                                      throws java.io.IOException
        Returns connection output stream.
        Throws:
        java.io.IOException
      • getInputStream

        java.io.InputStream getInputStream()
                                    throws java.io.IOException
        Returns connection input stream.
        Throws:
        java.io.IOException
      • close

        void close()
        Closes connection. Ignores all exceptions.
      • setTimeout

        void setTimeout​(int milliseconds)
        Sets the timeout for connections, in milliseconds. With this option set to a non-zero timeout, connection will block for only this amount of time. If the timeout expires, an Exception is raised. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.