public final class SocketConnectionConfiguration extends TcpConnectionConfiguration<java.net.Socket>
A configuration for a TCP connection using Socket
. It allows you to configure various connection settings for a TCP socket connection, most importantly the host address and port, but also a whitespace keep-alive interval, a custom socket factory, a custom SSL context and compression methods.
SocketConnectionConfiguration socketConfiguration = SocketConnectionConfiguration.builder()
.hostname("localhost")
.port(5222)
.sslContext(sslContext)
.channelEncryption(ChannelEncryption.DISABLED)
.build();
This class is immutable.
BoshConnectionConfiguration
,
SocketConnection
Modifier and Type | Class and Description |
---|---|
static class |
SocketConnectionConfiguration.Builder
A builder to create a
TcpConnectionConfiguration instance. |
Modifier and Type | Method and Description |
---|---|
static SocketConnectionConfiguration.Builder |
builder()
Creates a new builder for this class.
|
Connection |
createConnection(XmppSession xmppSession)
A factory method to create the connection.
|
static SocketConnectionConfiguration |
getDefault()
Gets the default configuration.
|
javax.net.SocketFactory |
getSocketFactory()
Gets the socket factory.
|
static void |
setDefault(SocketConnectionConfiguration configuration)
Sets the default configuration.
|
getKeepAliveInterval
getChannelEncryption, getCompressionMethods, getConnectTimeout, getHostname, getHostnameVerifier, getPort, getProxy, getSSLContext, toString
public static SocketConnectionConfiguration getDefault()
Gets the default configuration.
public static void setDefault(SocketConnectionConfiguration configuration)
Sets the default configuration.
configuration
- The default configuration.public static SocketConnectionConfiguration.Builder builder()
Creates a new builder for this class.
public final Connection createConnection(XmppSession xmppSession) throws java.lang.Exception
ClientConnectionConfiguration
A factory method to create the connection.
createConnection
in class ClientConnectionConfiguration
xmppSession
- The XMPP session, which is associated with the connection.java.lang.Exception
- Any exception which may occur during connection establishment.public final javax.net.SocketFactory getSocketFactory()
Gets the socket factory.
Copyright © 2014–2019 XMPP.rocks. All rights reserved.