assertNotNull(server);
server.start();
final AsyncHttpClient c = new AsyncHttpClient(new AsyncHttpClientConfig.Builder().setMaxRequestRetry(0).build());
final CountDownLatch l = new CountDownLatch(getCount());
Client client = ClientFactory.getDefault().newClient();
RequestBuilder request = client.newRequestBuilder();
request.method(Request.METHOD.GET).uri(targetUrl);
request.transport(transport());
request.encoder(new Encoder<String, String>() {
@Override
public String encode(String s) {
return s;
}
});
Socket[] sockets = new Socket[getCount()];
request.decoder(new Decoder<String, String>() {
@Override
public String decode(Event evntp, String s) {
return s;
}
});
for (int i = 0; i < getCount(); i++) {
sockets[i] = client.create(client.newOptionsBuilder().runtime(c, true).build());
sockets[i].on(new Function<Integer>() {
@Override
public void on(Integer statusCode) {
}
});