Beispiel #1
0
 private void createConn(Channel ch, Handler<ClientConnection> connectHandler) {
   final ClientConnection conn =
       new ClientConnection(
           vertx, DefaultHttpClient.this, ch, tcpHelper.isSSL(), host, port, keepAlive, actualCtx);
   conn.closeHandler(
       new VoidHandler() {
         public void handle() {
           // The connection has been closed - tell the pool about it, this allows the pool to
           // create more
           // connections. Note the pool doesn't actually remove the connection, when the next
           // person to get a connection
           // gets the closed on, they will check if it's closed and if so get another one.
           pool.connectionClosed();
         }
       });
   connectionMap.put(ch, conn);
   connectHandler.handle(conn);
 }