new NetServer()
Represents a TCP or SSL server.
- Source:
Extends
- module:vertx/ssl_support~SSLSupport
- module:vertx/ssl_support~ServerSSLSupport
- module:vertx/tcp_support~TCPSupport
- module:vertx/tcp_support~ServerTCPSupport
Methods
-
acceptBacklog(backlog) → {number|Object}
-
Set or get the server's accept backlog
Parameters:
Name Type Argument Description backlognumber <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- number | Object
-
clientAuthRequired(required) → {boolean|Object}
-
Get or set whether client authorization is required
Parameters:
Name Type Argument Description requiredboolean <optional>
If provided, sets whether client authorization is required - Inherited From:
- Source:
Returns:
the current status, orthis- Type
- boolean | Object
-
close(handler)
-
Close the server. This will close any open connections.
Parameters:
Name Type Argument Description handlerHandler <optional>
the handler to call when the close operation has completed - Source:
-
connectHandler(handler) → {module:vertx/net.NetServer}
-
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
module:vertx/net.NetSocketand passes it to the connect handler.Parameters:
Name Type Description handlerConnectHandler the connection handler - Source:
Returns:
this -
host() → {string}
-
The host name
- Source:
Returns:
the host- Type
- string
-
keyStorePassword(password) → {boolean|Object}
-
Get or set the current keystore password for this object.
Parameters:
Name Type Argument Description passwordstring <optional>
If provided, sets the keystore password - Inherited From:
- Source:
Returns:
the current password, orthis.- Type
- boolean | Object
-
keyStorePath(path) → {boolean|Object}
-
Get or set the current keystore path for this object.
Parameters:
Name Type Argument Description pathstring <optional>
If provided, sets the keystore path - Inherited From:
- Source:
Returns:
the current path, orthis.- Type
- boolean | Object
-
listen(port, host, handler) → {module:vertx/net.NetServer}
-
Tell the server to start listening on all available interfaces and
port. Be aware this is an async operation and the server may not bound on return of the method.Parameters:
Name Type Argument Description portnumber The network port to listen on hoststring <optional>
The hostname or IP address to listen on handlerListenHandler <optional>
The listen handler - Source:
Returns:
this -
port() → {number}
-
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.
- Source:
Returns:
The port number the server is listening on- Type
- number
-
receiveBufferSize(size) → {number|Object}
-
Set or get the receive buffer size
Parameters:
Name Type Argument Description sizenumber <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- number | Object
-
reuseAddress(reuse) → {boolean|Object}
-
Set or get the TCP reuse address value
Parameters:
Name Type Argument Description reuseboolean <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- boolean | Object
-
sendBufferSize(size) → {number|Object}
-
Set or get the send buffer size
Parameters:
Name Type Argument Description sizenumber <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- number | Object
-
soLinger(linger) → {boolean|Object}
-
Set or get the TCP so linger value
Parameters:
Name Type Argument Description lingerboolean <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- boolean | Object
-
ssl(ssl) → {boolean|Object}
-
Get or set the current SSL support for this object.
Parameters:
Name Type Argument Description sslboolean <optional>
If provided, sets whether this object supports SSL - Inherited From:
- Source:
Returns:
the current status, orthis.- Type
- boolean | Object
-
tcpKeepAlive(keepAlive) → {boolean|Object}
-
Set or get the TCP keep-alive value
Parameters:
Name Type Argument Description keepAliveboolean <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- boolean | Object
-
tcpNoDelay(nodelay) → {boolean|Object}
-
Set or get the TCP no delay value.
Parameters:
Name Type Argument Description nodelayboolean <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- boolean | Object
-
trafficClass(class) → {number|Object}
-
Set or get the TCP traffic class
Parameters:
Name Type Argument Description classnumber <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- number | Object
-
trustStorePassword(password) → {boolean|Object}
-
Get or set the current trust store password for this object.
Parameters:
Name Type Argument Description passwordstring <optional>
If provided, sets the trust store password - Inherited From:
- Source:
Returns:
the current password, orthis.- Type
- boolean | Object
-
trustStorePath(path) → {boolean|Object}
-
Get or set the current trust store path for this object.
Parameters:
Name Type Argument Description pathstring <optional>
If provided, sets the trust store path - Inherited From:
- Source:
Returns:
the current path, orthis.- Type
- boolean | Object
-
usePooledBuffers(use) → {boolean|Object}
-
Set or get if vertx should use pooled buffers for performance reasons. Doing so will give the best throughput but may need a bit higher memory footprint.
Parameters:
Name Type Argument Description useboolean <optional>
If provided, set the value; if not, returns the current value. - Inherited From:
- Source:
Returns:
the value or this- Type
- boolean | Object