Beispiel #1
0
 void returnConnection(final ClientConnection conn) {
   if (!conn.keepAlive) {
     // Close it
     conn.internalClose();
   } else {
     pool.returnConnection(conn);
   }
 }
Beispiel #2
0
 void getConnection(Handler<ClientConnection> handler, long contextID) {
   pool.getConnection(handler, contextID);
 }
Beispiel #3
0
 /** Returns the maximum number of connections in the pool */
 public int getMaxPoolSize() {
   return pool.getMaxPoolSize();
 }
Beispiel #4
0
 /** Close the HTTP client. This will cause any pooled HTTP connections to be closed. */
 public void close() {
   pool.close();
   for (ClientConnection conn : connectionMap.values()) {
     conn.internalClose();
   }
 }
Beispiel #5
0
 /**
  * Set the maximum pool size to the value specified by {@code maxConnections}
  *
  * <p>The client will maintain up to {@code maxConnections} HTTP connections in an internal pool
  *
  * <p>
  *
  * @return A reference to this, so multiple invocations can be chained together.
  */
 public HttpClient setMaxPoolSize(int maxConnections) {
   pool.setMaxPoolSize(maxConnections);
   return this;
 }