io.vertx.rxjava.core.net

## Class NetServer

- java.lang.Object
- - io.vertx.rxjava.core.net.NetServer

- All Implemented Interfaces:
    Measured

      public class NetServer
      extends Object
      implements Measured

  Represents a TCP server

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TypeArg<NetServer>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetServer(NetServer delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `actualPort()` The actual port the server is listening on.
    `void` | `close()` Close the server.
    `void` | `close(Handler<AsyncResult<Void>> completionHandler)` Like `close()` but supplying a handler that will be notified when close is complete.
    `rx.Observable<Void>` | `closeObservable()` Deprecated. use `rxClose()` instead
    `NetServer` | `connectHandler(Handler<NetSocket> handler)` Supply a connect handler for this server.
    `ReadStream<NetSocket>` | `connectStream()` Return the connect stream for this server.
    `NetServer` | `getDelegate()`
    `boolean` | `isMetricsEnabled()` Whether the metrics are enabled for this measured object
    `NetServer` | `listen()` Start listening on the port and host as configured in the `NetServerOptions` used when creating the server.
    `NetServer` | `listen(Handler<AsyncResult<NetServer>> listenHandler)` Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
    `NetServer` | `listen(int port)` Start listening on the specified port and host "0.0.0.0", ignoring post and host configured in the `NetServerOptions` used when creating the server.
    `NetServer` | `listen(int port, Handler<AsyncResult<NetServer>> listenHandler)` Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
    `NetServer` | `listen(int port, String host)` Start listening on the specified port and host, ignoring post and host configured in the `NetServerOptions` used when creating the server.
    `NetServer` | `listen(int port, String host, Handler<AsyncResult<NetServer>> listenHandler)` Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
    `rx.Observable<NetServer>` | `listenObservable()` Deprecated. use `rxListen()` instead
    `rx.Observable<NetServer>` | `listenObservable(int port)` Deprecated. use `rxListen()` instead
    `rx.Observable<NetServer>` | `listenObservable(int port, String host)` Deprecated. use `rxListen()` instead
    `static NetServer` | `newInstance(NetServer arg)`
    `rx.Single<Void>` | `rxClose()` Like `close()` but supplying a handler that will be notified when close is complete.
    `rx.Single<NetServer>` | `rxListen()` Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
    `rx.Single<NetServer>` | `rxListen(int port)` Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
    `rx.Single<NetServer>` | `rxListen(int port, String host)` Like `listen()` but providing a handler that will be notified when the server is listening, or fails.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.rxjava.core.metrics.Measured

      `newInstance`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final TypeArg<NetServer> __TYPE_ARG

  - ### Constructor Detail

    - #### NetServer

          public NetServer(NetServer delegate)

  - ### Method Detail

    - #### getDelegate

          public NetServer getDelegate()

      Specified by:
        `getDelegate` in interface `Measured`

    - #### isMetricsEnabled

          public boolean isMetricsEnabled()

      Whether the metrics are enabled for this measured object
      Specified by:
        `isMetricsEnabled` in interface `Measured`
      Returns:
        true if the metrics are enabled

    - #### connectStream

          public ReadStream<NetSocket> connectStream()

      Return the connect stream for this server. The server can only have at most one handler at any one time. As the server accepts TCP or SSL connections it creates an instance of `NetSocket` and passes it to the connect stream .
      Returns:
        the connect stream

    - #### connectHandler

          public NetServer connectHandler(Handler<NetSocket> handler)

      Supply a connect handler for this server. The server can only have at most one connect handler at any one time. As the server accepts TCP or SSL connections it creates an instance of `NetSocket` and passes it to the connect handler.
      Parameters:
        `handler` -
      Returns:
        a reference to this, so the API can be used fluently

    - #### listen

          public NetServer listen()

      Start listening on the port and host as configured in the `NetServerOptions` used when creating the server.

      The server may not be listening until some time after the call to listen has returned.

      Returns:
        a reference to this, so the API can be used fluently

    - #### listen

          public NetServer listen(Handler<AsyncResult<NetServer>> listenHandler)

      Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
      Parameters:
        `listenHandler` - handler that will be notified when listening or failed
      Returns:
        a reference to this, so the API can be used fluently

    - #### listenObservable

          @Deprecated
          public rx.Observable<NetServer> listenObservable()

      Deprecated. use `rxListen()` instead
      Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
      Returns:

    - #### rxListen

          public rx.Single<NetServer> rxListen()

      Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
      Returns:

    - #### listen

          public NetServer listen(int port,
                                  String host)

      Start listening on the specified port and host, ignoring post and host configured in the `NetServerOptions` used when creating the server.

      Port `0` can be specified meaning "choose an random port".

      Host `0.0.0.0` can be specified meaning "listen on all available interfaces".

      The server may not be listening until some time after the call to listen has returned.

      Parameters:
        `port` -
        `host` -
      Returns:
        a reference to this, so the API can be used fluently

    - #### listen

          public NetServer listen(int port,
                                  String host,
                                  Handler<AsyncResult<NetServer>> listenHandler)

      Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
      Parameters:
        `port` - the port to listen on
        `host` - the host to listen on
        `listenHandler` - handler that will be notified when listening or failed
      Returns:
        a reference to this, so the API can be used fluently

    - #### listenObservable

          @Deprecated
          public rx.Observable<NetServer> listenObservable(int port,
                                                                       String host)

      Deprecated. use `rxListen()` instead
      Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
      Parameters:
        `port` - the port to listen on
        `host` - the host to listen on
      Returns:

    - #### rxListen

          public rx.Single<NetServer> rxListen(int port,
                                               String host)

      Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
      Parameters:
        `port` - the port to listen on
        `host` - the host to listen on
      Returns:

    - #### listen

          public NetServer listen(int port)

      Start listening on the specified port and host "0.0.0.0", ignoring post and host configured in the `NetServerOptions` used when creating the server.

      Port `0` can be specified meaning "choose an random port".

      The server may not be listening until some time after the call to listen has returned.

      Parameters:
        `port` -
      Returns:
        a reference to this, so the API can be used fluently

    - #### listen

          public NetServer listen(int port,
                                  Handler<AsyncResult<NetServer>> listenHandler)

      Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
      Parameters:
        `port` - the port to listen on
        `listenHandler` - handler that will be notified when listening or failed
      Returns:
        a reference to this, so the API can be used fluently

    - #### listenObservable

          @Deprecated
          public rx.Observable<NetServer> listenObservable(int port)

      Deprecated. use `rxListen()` instead
      Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
      Parameters:
        `port` - the port to listen on
      Returns:

    - #### rxListen

          public rx.Single<NetServer> rxListen(int port)

      Like `listen()` but providing a handler that will be notified when the server is listening, or fails.
      Parameters:
        `port` - the port to listen on
      Returns:

    - #### close

          public void close()

      Close the server. This will close any currently open connections. The close may not complete until after this method has returned.

    - #### close

          public void close(Handler<AsyncResult<Void>> completionHandler)

      Like `close()` but supplying a handler that will be notified when close is complete.
      Parameters:
        `completionHandler` - the handler

    - #### closeObservable

          @Deprecated
          public rx.Observable<Void> closeObservable()

      Deprecated. use `rxClose()` instead
      Like `close()` but supplying a handler that will be notified when close is complete.
      Returns:

    - #### rxClose

          public rx.Single<Void> rxClose()

      Like `close()` but supplying a handler that will be notified when close is complete.
      Returns:

    - #### actualPort

          public int actualPort()

      The actual port the server is listening on. This is useful if you bound the server specifying 0 as port number signifying an ephemeral port
      Returns:
        the actual port the server is listening on.

    - #### newInstance

          public static NetServer newInstance(NetServer arg)

Copyright © 2017. All rights reserved.