| java.lang.Object net.matuschek.http.connection.HttpConnection
HttpConnection | public class HttpConnection (Code) | | An HttpConnection object simply represents a TCP socket connection
between the client and an HTTP server.
author: Daniel Matuschek version: $Id: HttpConnection.java,v 1.4 2002/05/31 14:45:55 matuschd Exp $ |
Method Summary | |
public void | close() | public static HttpConnection | createConnection(InetAddress address, int port, int timeout) Create a new HttpConnection to the given host and port.
Parameters: address - the IP address to connect to Parameters: port - the port to connect to (usually 80 for HTTP) Parameters: timeout - connection timeout in milliseconds. | public InputStream | getInputStream() Gets the InputStream of this connection. | public OutputStream | getOutputStream() Gets the OutputStream of this connection. |
HttpConnection | protected HttpConnection()(Code) | | Create a new HttpConnection
|
HttpConnection | public HttpConnection(Socket socket)(Code) | | Construct an HTTP connection object based on an existing socket
connection.
Parameters: socket - a Socket object containing a socket connection that is already established. |
close | public void close()(Code) | | Close this connection (including the streams)
|
createConnection | public static HttpConnection createConnection(InetAddress address, int port, int timeout) throws IOException(Code) | | Create a new HttpConnection to the given host and port.
Parameters: address - the IP address to connect to Parameters: port - the port to connect to (usually 80 for HTTP) Parameters: timeout - connection timeout in milliseconds. If the connectioncould not be established after this time, an exception willbe thrown. This timeout will also be set as timeout for theTCP connection (so timeout)An timeout of 0 will be interpreted as an infinite timeout. a new HttpConnection object exception: IOException - if the TCP socket connection couldnot be established |
getInputStream | public InputStream getInputStream() throws IOException(Code) | | Gets the InputStream of this connection. Don't close this stream,
but close the HttpConnection when finished.
an InputStream or null if no connection is established exception: IOException - if an I/O error occurs when creating the stream |
getOutputStream | public OutputStream getOutputStream() throws IOException(Code) | | Gets the OutputStream of this connection. Don't close this stream,
but close the HttpConnection when finished.
an OutputStream or null if no connection is established exception: IOException - if an I/O error occurs when creating the stream |
|
|