Package jodd.http
Interface HttpConnection
-
- All Known Implementing Classes:
SocketHttpConnection,SocketHttpSecureConnection
public interface HttpConnectionHttp connection. Created byHttpConnectionProvider.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes connection.java.io.InputStreamgetInputStream()Returns connection input stream.java.io.OutputStreamgetOutputStream()Returns connection output stream.voidinit()Initializes http connection after socket is created.voidsetTimeout(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, likesetTimeout(int).- Throws:
java.io.IOException
-
getOutputStream
java.io.OutputStream getOutputStream() throws java.io.IOExceptionReturns connection output stream.- Throws:
java.io.IOException
-
getInputStream
java.io.InputStream getInputStream() throws java.io.IOExceptionReturns 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.
-
-