/** * The port on which this server should listen, assuming it should bind to all available addresses. * * @param port The port to listen on. * @return {@literal this} */ @SuppressWarnings("unchecked") public S listen(int port) { return listen(new InetSocketAddress(port)); }
/** * The host and port on which this server should listen. * * @param host The host to bind to. * @param port The port to listen on. * @return {@literal this} */ @SuppressWarnings("unchecked") public S listen(String host, int port) { if (null == host) { host = "localhost"; } return listen(new InetSocketAddress(host, port)); }