Package net.reversehttp

Examples of net.reversehttp.NormalHttpServer


        configureLogging();
        try {
            int port = (args.length > 0) ? Integer.parseInt(args[0]) : 8888;
            final Logger logger = Logger.getLogger(EndpointService.class.getName());
            logger.log(Level.FINE, "Starting on port " + port);
            HttpServer httpd = new NormalHttpServer(port,
                    new EndpointService(new Endpoint() {
                        public boolean acceptSubscriptionChange(String mode, String topic, String token, int leaseSeconds) {
                            System.out.println("Subscription change: "+mode+", "+topic+", "+token+", "+leaseSeconds);
                            return true;
                        }
                        public void handleDelivery(String topic, byte[] body) {
                            System.out.println("Received message:\n\"" + new String(body) + "\"");
                        }
                    }));
            httpd.serve();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here


        configureLogging();
        try {
            int port = (args.length > 0) ? Integer.parseInt(args[0]) : 8000;
      Logger.getLogger(TestReverseHttpService.class.getName()).log
    (Level.FINE, "Starting on port " + port);
            HttpServer httpd = new NormalHttpServer(port,
                    new TestNormalHttpService());
            httpd.serve();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

            ServiceContainer container = new ServiceContainer(ownAddress
                    .getDomain());
            container.bindName(ownAddress, new Sub(ownAddress, Address
                    .parse(sourceStr)));
            HttpServer httpd = new NormalHttpServer(port, container);
            httpd.serve();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of net.reversehttp.NormalHttpServer

Copyright © 2018 www.massapicom. 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.