Class SocketHttpConnection
java.lang.Object
jodd.http.net.SocketHttpConnection
- All Implemented Interfaces:
HttpConnection
- Direct Known Subclasses:
SocketHttpSecureConnection
Socket-based
HttpConnection.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes connection.Returns connection input stream.Returns connection output stream.ReturnsSocketused by this connection.voidinit()Initializes http connection after socket is created.voidsetTimeout(int milliseconds) Sets the timeout for connections, in milliseconds.
-
Field Details
-
socket
-
timeout
private int timeout
-
-
Constructor Details
-
SocketHttpConnection
-
-
Method Details
-
init
Description copied from interface:HttpConnectionInitializes http connection after socket is created. Applies configurations, likeHttpConnection.setTimeout(int).- Specified by:
initin interfaceHttpConnection- Throws:
IOException
-
getOutputStream
Description copied from interface:HttpConnectionReturns connection output stream.- Specified by:
getOutputStreamin interfaceHttpConnection- Throws:
IOException
-
getInputStream
Description copied from interface:HttpConnectionReturns connection input stream.- Specified by:
getInputStreamin interfaceHttpConnection- Throws:
IOException
-
close
public void close()Description copied from interface:HttpConnectionCloses connection. Ignores all exceptions.- Specified by:
closein interfaceHttpConnection
-
setTimeout
public void setTimeout(int milliseconds) Description copied from interface:HttpConnectionSets 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.- Specified by:
setTimeoutin interfaceHttpConnection
-
getSocket
ReturnsSocketused by this connection.
-