Searched defs:connection (Results 1 - 11 of 11) sorted by relevance

/libcore/luni/src/main/java/java/net/
H A DResponseCache.java75 * @param connection
76 * the connection to fetch the response.
84 public abstract CacheRequest put(URI uri, URLConnection connection) throws IOException; argument
/libcore/luni/src/main/java/libcore/net/http/
H A DHttpConnectionPool.java65 // First try to reuse an existing HTTP connection.
69 HttpConnection connection = connections.remove(connections.size() - 1);
74 if (connection.isEligibleForRecycling()) {
76 Socket socket = connection.getSocket();
78 return connection;
84 * We couldn't find a reusable connection, so we need to create a new
85 * connection. We're careful not to do so while holding a lock!
90 public void recycle(HttpConnection connection) { argument
91 Socket socket = connection.getSocket();
97 connection
[all...]
H A DHttpURLConnectionImpl.java49 * currently connected. Instead, it indicates whether a connection has ever been
50 * attempted. Once a connection has been attempted, certain properties (request
52 * connection} field on this class for null/non-null to determine of an instance
89 // Calling disconnect() before a connection exists should have no effect.
167 "Cannot access request header fields after connection is set");
264 HttpConnection connection, RetryableOutputStream requestBody) throws IOException {
265 return new HttpEngine(this, method, requestHeaders, connection, requestBody);
286 * If the connection was recycled, its staleness may have caused
287 * the failure. Silently retry with a different connection.
353 * headers, proxy and target URL or this connection ma
263 newHttpEngine(String method, RawHeaders requestHeaders, HttpConnection connection, RetryableOutputStream requestBody) argument
[all...]
H A DRequestHeaders.java57 private String connection; field in class:RequestHeaders
111 connection = value;
127 return "close".equalsIgnoreCase(connection);
179 return connection;
234 public void setConnection(String connection) { argument
235 if (this.connection != null) {
238 headers.add("Connection", connection);
239 this.connection = connection;
H A DResponseHeaders.java111 private String connection; field in class:ResponseHeaders
172 connection = value;
200 return "close".equalsIgnoreCase(connection);
264 return connection;
H A DHttpEngine.java66 * <p>This class may hold a socket connection that needs to be released or
67 * recycled. By default, this socket connection is held when the last byte of
68 * the response is consumed. To release the connection when it is no longer
116 protected HttpConnection connection; field in class:HttpEngine
171 * True if the socket connection should be released to the connection pool
176 /** True if the socket connection is no longer needed by this engine. */
182 * @param connection the connection used for an intermediate response
184 * redirect. This engine assumes ownership of the connection an
187 HttpEngine(HttpURLConnectionImpl policy, String method, RawHeaders requestHeaders, HttpConnection connection, RetryableOutputStream requestBodyOut) argument
[all...]
H A DHttpsURLConnectionImpl.java384 HttpConnection connection, RetryableOutputStream requestBody) throws IOException {
385 return new HttpsEngine(this, method, requestHeaders, connection, requestBody,
403 * Local stash of HttpsEngine.connection.sslSocket for answering
415 * @param policy the HttpURLConnectionImpl with connection configuration
419 HttpConnection connection, RetryableOutputStream requestBody,
421 super(policy, method, requestHeaders, connection, requestBody);
422 this.sslSocket = connection != null ? connection.getSecureSocketIfConnected() : null;
427 // first try an SSL connection with compression and
446 sslSocket = connection
383 newHttpEngine(String method, RawHeaders requestHeaders, HttpConnection connection, RetryableOutputStream requestBody) argument
418 HttpsEngine(HttpURLConnectionImpl policy, String method, RawHeaders requestHeaders, HttpConnection connection, RetryableOutputStream requestBody, HttpsURLConnectionImpl enclosing) argument
487 makeTunnel(HttpURLConnectionImpl policy, HttpConnection connection, RequestHeaders requestHeaders) argument
533 ProxyConnectEngine(HttpURLConnectionImpl policy, RawHeaders requestHeaders, HttpConnection connection) argument
[all...]
/libcore/luni/src/test/java/libcore/sqlite/
H A DQueryTimeoutTest.java43 private Connection connection; field in class:QueryTimeoutTest
47 connection = Support_SQL.getConnection();
58 Database database = ((JDBCConnection) connection).getSQLiteDatabase();
74 connection.setAutoCommit(true);
78 connection.close();
85 statement = connection.createStatement();
95 PreparedStatement statement = connection.prepareStatement(FETCH_QUERY);
113 PreparedStatement statement = connection.prepareStatement(EXEC_QUERY);
125 connection.setAutoCommit(true);
126 PreparedStatement statement = connection
[all...]
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/https/
H A DHttpsURLConnectionTest.java84 // read/connection timeout value
133 // create url connection to be tested
135 HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
136 connection.setSSLSocketFactory(ctx.getSocketFactory());
139 SSLSocket peerSocket = (SSLSocket) doInteraction(connection, ss);
141 // check the connection state
142 checkConnectionStateParameters(connection, peerSocket);
145 connection.connect();
149 * Tests the behaviour of HTTPS connection in case of unavailability
164 // create url connection t
1062 private HttpsURLConnection connection; field in class:HttpsURLConnectionTest.ClientConnectionWork
1068 ClientConnectionWork(HttpsURLConnection connection) argument
[all...]
/libcore/luni/src/test/java/libcore/java/net/
H A DURLConnectionTest.java222 HttpURLConnection connection = (HttpURLConnection) server.getUrl("/").openConnection();
223 assertNull(connection.getErrorStream());
229 HttpURLConnection connection = (HttpURLConnection) server.getUrl("/").openConnection();
230 assertEquals("A", readAscii(connection.getErrorStream(), Integer.MAX_VALUE));
234 // recycled connection doesn't get the unread tail of the first request's response.
313 .setBody("This connection won't pool properly")
315 server.enqueue(new MockResponse().setBody("This comes after a busted connection"));
318 assertContent("This connection won't pool properly", server.getUrl("/a").openConnection());
320 assertContent("This comes after a busted connection", server.getUrl("/b").openConnection());
321 // sequence number 0 means the HTTP socket connection wa
2283 assertContent(String expected, URLConnection connection, int limit) argument
2290 assertContent(String expected, URLConnection connection) argument
[all...]
/libcore/luni/src/test/java/libcore/net/http/
H A DHttpResponseCacheTest.java239 URLConnection connection = url.openConnection();
240 assertEquals(body, readAscii(connection));
305 HttpsURLConnection connection = (HttpsURLConnection) server.getUrl("/").openConnection();
306 connection.setSSLSocketFactory(testSSLContext.clientContext.getSocketFactory());
307 assertEquals("ABC", readAscii(connection));
309 // OpenJDK 6 fails on this line, complaining that the connection isn't open yet
310 String suite = connection.getCipherSuite();
311 List<Certificate> localCerts = toListOrNull(connection.getLocalCertificates());
312 List<Certificate> serverCerts = toListOrNull(connection.getServerCertificates());
313 Principal peerPrincipal = connection
1780 readAscii(URLConnection connection, int count) argument
1797 readAscii(URLConnection connection) argument
1807 assertGatewayTimeout(HttpURLConnection connection) argument
1866 put(URI uri, URLConnection connection) argument
[all...]

Completed in 200 milliseconds