public final class TcpConnection extends Connection
Unless specified otherwise, this connection sends a whitespace keep-alive every 60 seconds.
If no hostname is set (null or empty) the connection tries to resolve the hostname via an SRV DNS lookup.hostname, port| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
compressStream()
Compresses the stream.
|
void |
connect()
Connects to the specified XMPP server using a socket connection.
|
protected void |
restartStream()
Restarts the stream.
|
void |
send(ClientStreamElement element)
Sends an element.
|
getHostname, getPort, getProxy, getXmppSession, initializepublic void connect()
throws IOException
XmppSession.login(String, String) method.
If only a XMPP service domain has been specified, it is tried to resolve the FQDN via SRV lookup.
If that fails, it is tried to connect directly the XMPP service domain on port 5222.
If a hostname and port have been specified, these are used to establish the connection.
If a proxy has been specified, the connection is established through this proxy.
connect in class ConnectionIOException - If the underlying socket throws an exception.protected void compressStream()
ConnectioncompressStream in class Connectionpublic void send(ClientStreamElement element)
Connectionsend in class Connectionelement - The element.protected void restartStream()
ConnectionrestartStream in class Connectionpublic void close()
throws IOException
IOExceptionCopyright © 2014 XMPP.rocks. All rights reserved.