Search in sources :

Example 6 with ConnectionListener

use of org.webpieces.nio.api.handlers.ConnectionListener in project webpieces by deanhiller.

the class Http11ClientSimulator method openHttps.

public Http11Socket openHttps() {
    ConnectionListener listener = mgr.getHttpsConnection();
    MockTcpChannel channel = new MockTcpChannel(parser);
    CompletableFuture<DataListener> connected = listener.connected(channel, true);
    try {
        DataListener dataListener = connected.get(2, TimeUnit.SECONDS);
        return new Http11Socket(dataListener, channel, parser);
    } catch (Throwable e) {
        throw new RuntimeException(e);
    }
}
Also used : DataListener(org.webpieces.nio.api.handlers.DataListener) ConnectionListener(org.webpieces.nio.api.handlers.ConnectionListener)

Aggregations

ConnectionListener (org.webpieces.nio.api.handlers.ConnectionListener)6 DataListener (org.webpieces.nio.api.handlers.DataListener)6 InetSocketAddress (java.net.InetSocketAddress)2 Http2Config (com.webpieces.http2engine.api.client.Http2Config)1 InjectionConfig (com.webpieces.http2engine.api.client.InjectionConfig)1 Before (org.junit.Before)1 FrontendConfig (org.webpieces.frontend2.api.FrontendConfig)1 HttpFrontendManager (org.webpieces.frontend2.api.HttpFrontendManager)1 HttpServer (org.webpieces.frontend2.api.HttpServer)1 MockTcpServerChannel (org.webpieces.httpfrontend2.api.mock2.MockTcpServerChannel)1 OperationCallback (org.webpieces.nio.api.handlers.OperationCallback)1