use of org.webpieces.nio.api.handlers.DataListener in project webpieces by deanhiller.
the class AbstractHttp1Test method simulateClientConnecting.
private void simulateClientConnecting() throws InterruptedException, ExecutionException, TimeoutException {
ConnectionListener listener = mockChanMgr.getSingleConnectionListener();
CompletableFuture<DataListener> futureList = listener.connected(mockChannel, true);
DataListener dataListener = futureList.get(3, TimeUnit.SECONDS);
mockChannel.setDataListener(dataListener);
}
use of org.webpieces.nio.api.handlers.DataListener in project webpieces by deanhiller.
the class Http11ClientSimulator method openHttp.
public Http11Socket openHttp() {
ConnectionListener listener = mgr.getHttpConnection();
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);
}
}
use of org.webpieces.nio.api.handlers.DataListener 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);
}
}
Aggregations