Package io.vertx.core.net

Examples of io.vertx.core.net.NetServerOptions


          assertTrue(ctx instanceof WorkerContext);
        } else {
          assertTrue(ctx instanceof EventLoopContext);
        }
        Thread thr = Thread.currentThread();
        server = vertx.createNetServer(new NetServerOptions().setPort(1234));
        server.connectHandler(sock -> {
          sock.handler(buff -> {
            sock.write(buff);
          });
          assertSame(ctx, vertx.context());
View Full Code Here


  public void testInMultithreadedWorker() throws Exception {
    class MyVerticle extends AbstractVerticle {
      @Override
      public void start() {
        try {
          server = vertx.createNetServer(new NetServerOptions());
          fail("Should throw exception");
        } catch (IllegalStateException e) {
          // OK
        }
        try {
View Full Code Here

          }
        }
        clusterManager.<String, ServerID>getAsyncMultiMap("subs", null, ar2 -> {
          if (ar2.succeeded()) {
            AsyncMultiMap<String, ServerID> subs = ar2.result();
            NetServer server = createNetServer(new NetServerOptions().setPort(options.getClusterPort()).setHost(options.getClusterHost()));
            EventBusImpl.EventBusNetServer ebServer = new EventBusImpl.EventBusNetServer(server);
            server.listen(asyncResult -> {
              if (asyncResult.succeeded()) {
                // Obtain system configured public host/port
                int publicPort = Integer.getInteger("vertx.cluster.public.port", -1);
View Full Code Here

  private boolean listenersRun;
  private ContextImpl listenContext;

  public NetServerImpl(VertxInternal vertx, NetServerOptions options) {
    this.vertx = vertx;
    this.options = new NetServerOptions(options);
    this.sslHelper = new SSLHelper(options, KeyStoreHelper.create(vertx, options.getKeyStoreOptions()), KeyStoreHelper.create(vertx, options.getTrustStoreOptions()));
    this.creatingContext = vertx.getContext();
    if (creatingContext != null) {
      if (creatingContext.isWorker()) {
        throw new IllegalStateException("Cannot use NetServer in a worker verticle");
View Full Code Here

    assertTrue(vertx.metrics().isEmpty());
  }

  @Test
  public void testDummyNetServerMetrics() {
    NetServer server = vertx.createNetServer(new NetServerOptions());
    assertNull(server.metricBaseName());
    assertTrue(server.metrics().isEmpty());
  }
View Full Code Here

TOP

Related Classes of io.vertx.core.net.NetServerOptions

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.