org.vertx.java.core.net.impl

## Class DefaultNetServer

- java.lang.Object
- - org.vertx.java.core.net.impl.DefaultNetServer

All Implemented Interfaces:
  NetServer

    public class DefaultNetServer
    extends java.lang.Object
    implements NetServer

### Constructor Summary

Constructors
Constructor and Description
`DefaultNetServer(VertxInternal vertx)`

### Method Summary

Methods
`void` `close()` Close the server.
`void` `close(Handler<java.lang.Void> done)` Close the server.
`NetServer` `connectHandler(Handler<NetSocket> connectHandler)` Supply a connect handler for this server.
`java.lang.Integer` `getAcceptBacklog()`
`TCPSSLHelper.ClientAuth` `getClientAuth()`
`java.lang.String` `getKeyStorePassword()`
`java.lang.String` `getKeyStorePath()`
`java.lang.Integer` `getReceiveBufferSize()`
`java.lang.Integer` `getSendBufferSize()`
`javax.net.ssl.SSLContext` `getSSLContext()`
`java.lang.Integer` `getTrafficClass()`
`java.lang.String` `getTrustStorePassword()`
`java.lang.String` `getTrustStorePath()`
`java.lang.Boolean` `isReuseAddress()`
`java.lang.Boolean` `isSoLinger()`
`boolean` `isSSL()`
`java.lang.Boolean` `isTCPKeepAlive()`
`java.lang.Boolean` `isTCPNoDelay()`
`NetServer` `listen(int port)` Instruct the server to listen for incoming connections on the specified `port` and all available interfaces.
`NetServer` `listen(int port, java.lang.String host)` Instruct the server to listen for incoming connections on the specified `port` and `host`.
`NetServer` `setAcceptBacklog(int backlog)` Set the accept backlog
`NetServer` `setClientAuthRequired(boolean required)` Set `required` to true if you want the server to request client authentication from any connecting clients.
`NetServer` `setKeyStorePassword(java.lang.String pwd)` Set the password for the SSL key store.
`NetServer` `setKeyStorePath(java.lang.String path)` Set the path to the SSL key store.
`NetServer` `setReceiveBufferSize(int size)` Set the TCP receive buffer size for connections created by this instance to `size` in bytes.
`NetServer` `setReuseAddress(boolean reuse)` Set the TCP reuseAddress setting for connections created by this instance to `reuse`.
`NetServer` `setSendBufferSize(int size)` Set the TCP send buffer size for connections created by this instance to `size` in bytes.
`NetServer` `setSoLinger(boolean linger)` Set the TCP soLinger setting for connections created by this instance to `reuse`.
`NetServer` `setSSL(boolean ssl)` If `ssl` is `true`, this signifies that any connections will be SSL connections.
`NetServer` `setTCPKeepAlive(boolean keepAlive)` Set the TCP keepAlive setting for connections created by this instance to `keepAlive`.
`NetServer` `setTCPNoDelay(boolean tcpNoDelay)` If `tcpNoDelay` is set to `true` then Nagle's algorithm will turned off for the TCP connections created by this instance.
`NetServer` `setTrafficClass(int trafficClass)` Set the TCP trafficClass setting for connections created by this instance to `reuse`.
`NetServer` `setTrustStorePassword(java.lang.String pwd)` Set the password for the SSL trust store.
`NetServer` `setTrustStorePath(java.lang.String path)` Set the path to the SSL trust store.

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

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

### Constructor Detail

#### DefaultNetServer

    public DefaultNetServer(VertxInternal vertx)

### Method Detail

#### connectHandler

    public NetServer connectHandler(Handler<NetSocket> connectHandler)

Description copied from interface: `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 `NetSocket` and passes it to the connect handler.

Specified by:
  `connectHandler` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### listen

    public NetServer listen(int port)

Description copied from interface: `NetServer`
Instruct the server to listen for incoming connections on the specified `port` and all available interfaces.

Specified by:
  `listen` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### listen

    public NetServer listen(int port,
                   java.lang.String host)

Description copied from interface: `NetServer`
Instruct the server to listen for incoming connections on the specified `port` and `host`. `host` can be a host name or an IP address.

Specified by:
  `listen` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### close

    public void close()

Description copied from interface: `NetServer`
Close the server. This will close any currently open connections.

Specified by:
  `close` in interface `NetServer`

#### close

    public void close(Handler<java.lang.Void> done)

Description copied from interface: `NetServer`
Close the server. This will close any currently open connections. The event handler `done` will be called when the close is complete.

Specified by:
  `close` in interface `NetServer`

#### isTCPNoDelay

    public java.lang.Boolean isTCPNoDelay()

Specified by:
  `isTCPNoDelay` in interface `NetServer`
Returns:
  true if Nagle's algorithm is disabled.

#### getSendBufferSize

    public java.lang.Integer getSendBufferSize()

Specified by:
  `getSendBufferSize` in interface `NetServer`
Returns:
  The TCP send buffer size

#### getReceiveBufferSize

    public java.lang.Integer getReceiveBufferSize()

Specified by:
  `getReceiveBufferSize` in interface `NetServer`
Returns:
  The TCP receive buffer size

#### isTCPKeepAlive

    public java.lang.Boolean isTCPKeepAlive()

Specified by:
  `isTCPKeepAlive` in interface `NetServer`
Returns:
  true if TCP keep alive is enabled

#### isReuseAddress

    public java.lang.Boolean isReuseAddress()

Specified by:
  `isReuseAddress` in interface `NetServer`
Returns:
  The value of TCP reuse address

#### isSoLinger

    public java.lang.Boolean isSoLinger()

Specified by:
  `isSoLinger` in interface `NetServer`
Returns:
  the value of TCP so linger

#### getTrafficClass

    public java.lang.Integer getTrafficClass()

Specified by:
  `getTrafficClass` in interface `NetServer`
Returns:
  the value of TCP traffic class

#### getAcceptBacklog

    public java.lang.Integer getAcceptBacklog()

Specified by:
  `getAcceptBacklog` in interface `NetServer`
Returns:
  The accept backlog

#### setTCPNoDelay

    public NetServer setTCPNoDelay(boolean tcpNoDelay)

Description copied from interface: `NetServer`
If `tcpNoDelay` is set to `true` then Nagle's algorithm will turned off for the TCP connections created by this instance.

Specified by:
  `setTCPNoDelay` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setSendBufferSize

    public NetServer setSendBufferSize(int size)

Description copied from interface: `NetServer`
Set the TCP send buffer size for connections created by this instance to `size` in bytes.

Specified by:
  `setSendBufferSize` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setReceiveBufferSize

    public NetServer setReceiveBufferSize(int size)

Description copied from interface: `NetServer`
Set the TCP receive buffer size for connections created by this instance to `size` in bytes.

Specified by:
  `setReceiveBufferSize` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setTCPKeepAlive

    public NetServer setTCPKeepAlive(boolean keepAlive)

Description copied from interface: `NetServer`
Set the TCP keepAlive setting for connections created by this instance to `keepAlive`.

Specified by:
  `setTCPKeepAlive` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setReuseAddress

    public NetServer setReuseAddress(boolean reuse)

Description copied from interface: `NetServer`
Set the TCP reuseAddress setting for connections created by this instance to `reuse`.

Specified by:
  `setReuseAddress` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setSoLinger

    public NetServer setSoLinger(boolean linger)

Description copied from interface: `NetServer`
Set the TCP soLinger setting for connections created by this instance to `reuse`.

Specified by:
  `setSoLinger` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setTrafficClass

    public NetServer setTrafficClass(int trafficClass)

Description copied from interface: `NetServer`
Set the TCP trafficClass setting for connections created by this instance to `reuse`.

Specified by:
  `setTrafficClass` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### setAcceptBacklog

    public NetServer setAcceptBacklog(int backlog)

Description copied from interface: `NetServer`
Set the accept backlog

Specified by:
  `setAcceptBacklog` in interface `NetServer`
Returns:
  a reference to this so multiple method calls can be chained together

#### isSSL

    public boolean isSSL()

Specified by:
  `isSSL` in interface `NetServer`
Returns:
  true if this server will make SSL connections

#### getKeyStorePath

    public java.lang.String getKeyStorePath()

Specified by:
  `getKeyStorePath` in interface `NetServer`
Returns:
  The path to the key store

#### getKeyStorePassword

    public java.lang.String getKeyStorePassword()

Specified by:
  `getKeyStorePassword` in interface `NetServer`
Returns:
  The keystore password

#### getTrustStorePath

    public java.lang.String getTrustStorePath()

Specified by:
  `getTrustStorePath` in interface `NetServer`
Returns:
  The trust store path

#### getTrustStorePassword

    public java.lang.String getTrustStorePassword()

Specified by:
  `getTrustStorePassword` in interface `NetServer`
Returns:
  The trust store password

#### getClientAuth

    public TCPSSLHelper.ClientAuth getClientAuth()

#### getSSLContext

    public javax.net.ssl.SSLContext getSSLContext()

#### setSSL

    public NetServer setSSL(boolean ssl)

Description copied from interface: `NetServer`
If `ssl` is `true`, this signifies that any connections will be SSL connections.

Specified by:
  `setSSL` in interface `NetServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setKeyStorePath

    public NetServer setKeyStorePath(java.lang.String path)

Description copied from interface: `NetServer`
Set the path to the SSL key store. This method should only be used in SSL mode, i.e. after `NetServer.setSSL(boolean)` has been set to `true`.

The SSL key store is a standard Java Key Store which should contain the server certificate.

Specified by:
  `setKeyStorePath` in interface `NetServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setKeyStorePassword

    public NetServer setKeyStorePassword(java.lang.String pwd)

Description copied from interface: `NetServer`
Set the password for the SSL key store. This method should only be used in SSL mode, i.e. after `NetServer.setSSL(boolean)` has been set to `true`.

Specified by:
  `setKeyStorePassword` in interface `NetServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setTrustStorePath

    public NetServer setTrustStorePath(java.lang.String path)

Description copied from interface: `NetServer`
Set the path to the SSL trust store. This method should only be used in SSL mode, i.e. after `NetServer.setSSL(boolean)` has been set to `true`.

The trust store is a standard Java Key Store, and should contain the certificates of any clients that the server trusts - this is only necessary if client authentication is enabled.

Specified by:
  `setTrustStorePath` in interface `NetServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setTrustStorePassword

    public NetServer setTrustStorePassword(java.lang.String pwd)

Description copied from interface: `NetServer`
Set the password for the SSL trust store. This method should only be used in SSL mode, i.e. after `NetServer.setSSL(boolean)` has been set to `true`.

Specified by:
  `setTrustStorePassword` in interface `NetServer`
Returns:
  A reference to this, so multiple invocations can be chained together.

#### setClientAuthRequired

    public NetServer setClientAuthRequired(boolean required)

Description copied from interface: `NetServer`
Set `required` to true if you want the server to request client authentication from any connecting clients. This is an extra level of security in SSL, and requires clients to provide client certificates. Those certificates must be added to the server trust store.

Specified by:
  `setClientAuthRequired` in interface `NetServer`
Returns:
  A reference to this, so multiple invocations can be chained together.