Interface HttpConnection

All Known Implementing Classes:
SocketHttpConnection, SocketHttpSecureConnection

public interface HttpConnection
Http connection. Created by HttpConnectionProvider.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes connection.
    Returns connection input stream.
    Returns connection output stream.
    void
    Initializes http connection after socket is created.
    void
    setTimeout(int milliseconds)
    Sets the timeout for connections, in milliseconds.
  • Method Details

    • init

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

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

      InputStream getInputStream() throws IOException
      Returns connection input stream.
      Throws:
      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.