示例#1
0
 void returnConnection(final ClientConnection conn) {
   if (!conn.keepAlive) {
     // Close it
     conn.internalClose();
   } else {
     pool.returnConnection(conn);
   }
 }
示例#2
0
 void getConnection(Handler<ClientConnection> handler, long contextID) {
   pool.getConnection(handler, contextID);
 }
示例#3
0
 /** Returns the maximum number of connections in the pool */
 public int getMaxPoolSize() {
   return pool.getMaxPoolSize();
 }
示例#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();
   }
 }
示例#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;
 }