Examples of listen()


Examples of org.apache.http.nio.reactor.ListeningIOReactor.listen()

        handler.setEventListener(new EventLogger());
       
        IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params);
        ListeningIOReactor ioReactor = new DefaultListeningIOReactor(2, params);
        try {
            ioReactor.listen(new InetSocketAddress(8080));
            ioReactor.execute(ioEventDispatch);
        } catch (InterruptedIOException ex) {
            System.err.println("Interrupted");
        } catch (IOException e) {
            System.err.println("I/O error: " + e.getMessage());
View Full Code Here

Examples of org.apache.http.nio.reactor.ListeningIOReactor.listen()

    public static void main(String[] args) throws Exception {
        HttpParams params = new BasicHttpParams();
        IOEventDispatch ioEventDispatch = new DefaultIoEventDispatch();
        ListeningIOReactor ioReactor = new DefaultListeningIOReactor(2, params);
        ioReactor.listen(new InetSocketAddress(8080));
        try {
            ioReactor.execute(ioEventDispatch);
        } catch (InterruptedIOException ex) {
            System.err.println("Interrupted");
        } catch (IOException e) {
View Full Code Here

Examples of org.apache.http.nio.reactor.ListeningIOReactor.listen()

        NHttpServiceHandler handler = new FileServiceHandler(args[0], useFileChannels, params);
        IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params);
       
        try {
            ioReactor.listen(new InetSocketAddress(8080));
            ioReactor.execute(ioEventDispatch);
        } catch (InterruptedIOException ex) {
            System.err.println("Interrupted");
        } catch (IOException e) {
            System.err.println("I/O error: " + e.getMessage());
View Full Code Here

Examples of org.apache.http.nio.reactor.ListeningIOReactor.listen()

                null,
                params);
       
        ListeningIOReactor ioReactor = new DefaultListeningIOReactor(2, params);
        try {
            ioReactor.listen(new InetSocketAddress(8080));
            ioReactor.execute(ioEventDispatch);
        } catch (InterruptedIOException ex) {
            System.err.println("Interrupted");
        } catch (IOException e) {
            System.err.println("I/O error: " + e.getMessage());
View Full Code Here

Examples of org.apache.http.nio.reactor.ListeningIOReactor.listen()

        handler.setEventListener(new EventLogger());
       
        IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params);
        ListeningIOReactor ioReactor = new DefaultListeningIOReactor(2, params);
        try {
            ioReactor.listen(new InetSocketAddress(8080));
            ioReactor.execute(ioEventDispatch);
        } catch (InterruptedIOException ex) {
            System.err.println("Interrupted");
        } catch (IOException e) {
            System.err.println("I/O error: " + e.getMessage());
View Full Code Here

Examples of org.apache.http.nio.reactor.ListeningIOReactor.listen()

        Set<ListenerEndpoint> endpoints = ioreactor.getEndpoints();
        Assert.assertNotNull(endpoints);
        Assert.assertEquals(0, endpoints.size());

        ListenerEndpoint endpoint1 = ioreactor.listen(new InetSocketAddress(0));
        endpoint1.waitFor();

        ListenerEndpoint endpoint2 = ioreactor.listen(new InetSocketAddress(0));
        endpoint2.waitFor();
        int port = ((InetSocketAddress) endpoint2.getAddress()).getPort();
View Full Code Here

Examples of org.apache.http.nio.reactor.ListeningIOReactor.listen()

        Assert.assertEquals(0, endpoints.size());

        ListenerEndpoint endpoint1 = ioreactor.listen(new InetSocketAddress(0));
        endpoint1.waitFor();

        ListenerEndpoint endpoint2 = ioreactor.listen(new InetSocketAddress(0));
        endpoint2.waitFor();
        int port = ((InetSocketAddress) endpoint2.getAddress()).getPort();

        endpoints = ioreactor.getEndpoints();
        Assert.assertNotNull(endpoints);
View Full Code Here

Examples of org.apache.http.nio.reactor.ListeningIOReactor.listen()

        });

        t.start();

        ListenerEndpoint endpoint1 = ioreactor.listen(new InetSocketAddress(0));
        endpoint1.waitFor();
        int port = ((InetSocketAddress) endpoint1.getAddress()).getPort();

        ListenerEndpoint endpoint2 = ioreactor.listen(new InetSocketAddress(port));
        endpoint2.waitFor();
View Full Code Here

Examples of org.apache.http.nio.reactor.ListeningIOReactor.listen()

        ListenerEndpoint endpoint1 = ioreactor.listen(new InetSocketAddress(0));
        endpoint1.waitFor();
        int port = ((InetSocketAddress) endpoint1.getAddress()).getPort();

        ListenerEndpoint endpoint2 = ioreactor.listen(new InetSocketAddress(port));
        endpoint2.waitFor();
        Assert.assertNotNull(endpoint2.getException());

        // I/O reactor is now expected to be shutting down
        latch.await(2000, TimeUnit.MILLISECONDS);
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.monitoring.servermonitor.HttpServerMonitor.listen()

            final Runnable httpServerMonitorRunnable = new Runnable() {
                @Override
                public void run() {
                    final HttpServerMonitor httpServerMonitor = new HttpServerMonitor();
                    httpServerMonitor.setTarget(system);
                    httpServerMonitor.listen();
                }
            };
            Threads.startThread(httpServerMonitorRunnable, "Monitor-2");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.