public IoFuture<ClientConnection> connect(InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, ByteBufferPool bufferPool, OptionMap options) { return connect(bindAddress, uri, worker, null, bufferPool, options); }
public IoFuture<ClientConnection> connect(final URI uri, final XnioIoThread ioThread, ByteBufferPool bufferPool, OptionMap options) { return connect((InetSocketAddress) null, uri, ioThread, null, bufferPool, options); }
public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioWorker worker, ByteBufferPool bufferPool, OptionMap options) { connect(listener, uri, worker, null, bufferPool, options); }
public IoFuture<ClientConnection> connect(final URI uri, final XnioWorker worker, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) { return connect((InetSocketAddress) null, uri, worker, ssl, bufferPool, options); }
public IoFuture<ClientConnection> connect(InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, ByteBufferPool bufferPool, OptionMap options) { return connect(bindAddress, uri, ioThread, null, bufferPool, options); }
public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioIoThread ioThread, ByteBufferPool bufferPool, OptionMap options) { connect(listener, uri, ioThread, null, bufferPool, options); }
public IoFuture<ClientConnection> connect(final URI uri, final XnioIoThread ioThread, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) { return connect((InetSocketAddress) null, uri, ioThread, ssl, bufferPool, options); }
public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, ByteBufferPool bufferPool, OptionMap options) { connect(listener, bindAddress, uri, worker, null, bufferPool, options); }
public IoFuture<ClientConnection> connect(final URI uri, final XnioWorker worker, ByteBufferPool bufferPool, OptionMap options) { return connect(uri, worker, null, bufferPool, options); }
public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, ByteBufferPool bufferPool, OptionMap options) { connect(listener, bindAddress, uri, ioThread, null, bufferPool, options); }
private void executeReceiveRequest(final TransportRequest transportRequest, final URI url, final HttpHeaders headers, final XhrClientSockJsSession session, final SettableListenableFuture<WebSocketSession> connectFuture) { if (logger.isTraceEnabled()) { logger.trace("Starting XHR receive request for " + url); } ClientCallback<ClientConnection> clientCallback = new ClientCallback<ClientConnection>() { @Override public void completed(ClientConnection connection) { ClientRequest request = new ClientRequest().setMethod(Methods.POST).setPath(url.getPath()); HttpString headerName = HttpString.tryFromString(HttpHeaders.HOST); request.getRequestHeaders().add(headerName, url.getHost()); addHttpHeaders(request, headers); HttpHeaders httpHeaders = transportRequest.getHttpRequestHeaders(); connection.sendRequest(request, createReceiveCallback(transportRequest, url, httpHeaders, session, connectFuture)); } @Override public void failed(IOException ex) { throw new SockJsTransportFailureException("Failed to execute request to " + url, ex); } }; this.httpClient.connect(clientCallback, url, this.worker, this.bufferPool, this.optionMap); }
client.connect(new ClientCallback<ClientConnection>() { @Override public void completed(final ClientConnection clientConnection) {
this.httpClient.connect(url, this.worker, this.bufferPool, this.optionMap).get(); try { ClientRequest request = new ClientRequest().setMethod(method).setPath(url.getPath());
UndertowClient.getInstance().connect(new ClientCallback<ClientConnection>() { @Override public void completed(final ClientConnection connection) {
UndertowClient.getInstance().connect(new ClientCallback<ClientConnection>() { @Override public void completed(ClientConnection result) {
@Override public void getConnection(ProxyTarget target, HttpServerExchange exchange, ProxyCallback<ProxyConnection> callback, long timeout, TimeUnit timeUnit) { ClientConnection existing = exchange.getConnection().getAttachment(clientAttachmentKey); if (existing != null) { if (existing.isOpen()) { //this connection already has a client, re-use it callback.completed(exchange, new ProxyConnection(existing, uri.getPath() == null ? "/" : uri.getPath())); return; } else { exchange.getConnection().removeAttachment(clientAttachmentKey); } } client.connect(new ConnectNotifier(callback, exchange), uri, exchange.getIoThread(), exchange.getConnection().getByteBufferPool(), OptionMap.EMPTY); }
data.connections++; client.connect(new ClientCallback<ClientConnection>() { @Override public void completed(final ClientConnection result) {
client.connect(new ClientCallback<ClientConnection>() { @Override public void completed(ClientConnection result) {
public void connect(final ClientCallback<ClientConnection> listener, final URI uri, final XnioIoThread ioThread, ByteBufferPool bufferPool, OptionMap options) { connect(listener, uri, ioThread, null, bufferPool, options); }
public ClientResponse send(URI uri, Optional<String> httpMethod) throws Exception { HttpString method = httpMethod.map(String::toUpperCase).map(Methods::fromString).orElse(Methods.GET); ClientRequest request = new ClientRequest(); request.setMethod(method); request.setPath(URISupport.pathAndQueryOf(uri)); IoFuture<ClientConnection> connectFuture = client.connect(uri, worker, pool, OptionMap.EMPTY); UndertowClientResponseFuture responseFuture = new UndertowClientResponseFuture(); connectFuture.get().sendRequest(request, responseFuture); // We should set a timeout return responseFuture.get().getResponse(); } }