Constructor and Description |
---|
DefaultNetServer(VertxInternal vertx) |
Modifier and Type | Method and Description |
---|---|
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.
|
public DefaultNetServer(VertxInternal vertx)
public NetServer connectHandler(Handler<NetSocket> connectHandler)
NetServer
NetSocket
and passes it to the
connect handler.connectHandler
in interface NetServer
public NetServer listen(int port)
NetServer
port
and all available interfaces.public NetServer listen(int port, java.lang.String host)
NetServer
port
and host
. host
can
be a host name or an IP address.public void close()
NetServer
public void close(Handler<java.lang.Void> done)
NetServer
done
will be called
when the close is complete.public java.lang.Boolean isTCPNoDelay()
isTCPNoDelay
in interface NetServer
public java.lang.Integer getSendBufferSize()
getSendBufferSize
in interface NetServer
public java.lang.Integer getReceiveBufferSize()
getReceiveBufferSize
in interface NetServer
public java.lang.Boolean isTCPKeepAlive()
isTCPKeepAlive
in interface NetServer
public java.lang.Boolean isReuseAddress()
isReuseAddress
in interface NetServer
public java.lang.Boolean isSoLinger()
isSoLinger
in interface NetServer
public java.lang.Integer getTrafficClass()
getTrafficClass
in interface NetServer
public java.lang.Integer getAcceptBacklog()
getAcceptBacklog
in interface NetServer
public NetServer setTCPNoDelay(boolean tcpNoDelay)
NetServer
tcpNoDelay
is set to true
then Nagle's algorithm
will turned off for the TCP connections created by this instance.setTCPNoDelay
in interface NetServer
public NetServer setSendBufferSize(int size)
NetServer
size
in bytes.setSendBufferSize
in interface NetServer
public NetServer setReceiveBufferSize(int size)
NetServer
size
in bytes.setReceiveBufferSize
in interface NetServer
public NetServer setTCPKeepAlive(boolean keepAlive)
NetServer
keepAlive
.setTCPKeepAlive
in interface NetServer
public NetServer setReuseAddress(boolean reuse)
NetServer
reuse
.setReuseAddress
in interface NetServer
public NetServer setSoLinger(boolean linger)
NetServer
reuse
.setSoLinger
in interface NetServer
public NetServer setTrafficClass(int trafficClass)
NetServer
reuse
.setTrafficClass
in interface NetServer
public NetServer setAcceptBacklog(int backlog)
NetServer
setAcceptBacklog
in interface NetServer
public boolean isSSL()
public java.lang.String getKeyStorePath()
getKeyStorePath
in interface NetServer
public java.lang.String getKeyStorePassword()
getKeyStorePassword
in interface NetServer
public java.lang.String getTrustStorePath()
getTrustStorePath
in interface NetServer
public java.lang.String getTrustStorePassword()
getTrustStorePassword
in interface NetServer
public TCPSSLHelper.ClientAuth getClientAuth()
public javax.net.ssl.SSLContext getSSLContext()
public NetServer setSSL(boolean ssl)
NetServer
ssl
is true
, this signifies that any connections will be SSL connections.public NetServer setKeyStorePath(java.lang.String path)
NetServer
NetServer.setSSL(boolean)
has been set to true
.The SSL key store is a standard Java Key Store which should contain the server certificate.
setKeyStorePath
in interface NetServer
public NetServer setKeyStorePassword(java.lang.String pwd)
NetServer
NetServer.setSSL(boolean)
has been set to true
.setKeyStorePassword
in interface NetServer
public NetServer setTrustStorePath(java.lang.String path)
NetServer
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.
setTrustStorePath
in interface NetServer
public NetServer setTrustStorePassword(java.lang.String pwd)
NetServer
NetServer.setSSL(boolean)
has been set to true
.setTrustStorePassword
in interface NetServer
public NetServer setClientAuthRequired(boolean required)
NetServer
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.setClientAuthRequired
in interface NetServer