Search in sources :

Example 1 with ClientDataListener

use of org.webpieces.nio.api.throughput.ClientDataListener in project webpieces by deanhiller.

the class IntegTestClientToEchoServer method testSoTimeoutOnSocket.

public void testSoTimeoutOnSocket() throws InterruptedException {
    runEchoServer();
    BufferPool pool2 = new TwoPools("pl", new SimpleMeterRegistry());
    DataListener listener = new ClientDataListener(pool2, recorder);
    Executor executor2 = Executors.newFixedThreadPool(10, new NamedThreadFactory("clientThread"));
    TCPChannel channel = createClientChannel(pool2, executor2);
    // TCPChannel channel = createNettyChannel();
    recorder.start();
    XFuture<Void> connect = channel.connect(new InetSocketAddress(4444), listener);
    connect.thenAccept(p -> runWriting(channel));
    synchronized (this) {
        this.wait();
    }
}
Also used : BufferPool(org.webpieces.data.api.BufferPool) Executor(java.util.concurrent.Executor) ClientDataListener(org.webpieces.nio.api.throughput.ClientDataListener) TwoPools(org.webpieces.data.api.TwoPools) NamedThreadFactory(org.webpieces.util.threading.NamedThreadFactory) TCPChannel(org.webpieces.nio.api.channels.TCPChannel) InetSocketAddress(java.net.InetSocketAddress) SimpleMeterRegistry(io.micrometer.core.instrument.simple.SimpleMeterRegistry) DataListener(org.webpieces.nio.api.handlers.DataListener) ClientDataListener(org.webpieces.nio.api.throughput.ClientDataListener)

Aggregations

SimpleMeterRegistry (io.micrometer.core.instrument.simple.SimpleMeterRegistry)1 InetSocketAddress (java.net.InetSocketAddress)1 Executor (java.util.concurrent.Executor)1 BufferPool (org.webpieces.data.api.BufferPool)1 TwoPools (org.webpieces.data.api.TwoPools)1 TCPChannel (org.webpieces.nio.api.channels.TCPChannel)1 DataListener (org.webpieces.nio.api.handlers.DataListener)1 ClientDataListener (org.webpieces.nio.api.throughput.ClientDataListener)1 NamedThreadFactory (org.webpieces.util.threading.NamedThreadFactory)1