public final class BoshConnection extends Connection
hostname, port| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the session as described in Terminating the HTTP Session.
|
void |
connect()
Connects to the server.
|
long |
detach()
Detaches this BOSH session without closing (aka terminating) it.
|
String |
getRoute()
Gets the route.
|
String |
getSessionId()
Gets the session id of this BOSH connection.
|
protected void |
restartStream()
Restarts the stream.
|
void |
send(ClientStreamElement element)
Sends an element.
|
compressStream, getHostname, getPort, getProxy, getXmppSession, initializepublic void connect()
throws IOException
Connectionconnect in class ConnectionIOException - If no connection could be established, e.g. due to unknown host.protected void restartStream()
Authentication and Resource Binding
Upon receiving the
<success/>element, the client MUST then ask the connection manager to restart the stream by sending a "restart request" that is structured as follows
- The BOSH
<body/>element MUST include a boolean 'restart' attribute (qualified by the 'urn:xmpp:xbosh' namespace) whose value is set to "true".- The BOSH
<body/>element SHOULD include the 'to' attribute.- The BOSH
<body/>element SHOULD include the 'xml:lang' attribute.- The BOSH
<body/>element SHOULD be empty (i.e., not contain an XML stanza). However, if the client includes an XML stanza in the body, the connection manager SHOULD ignore it.
restartStream in class Connectionpublic void close()
throws IOException
This method can be called from different threads:
IOException - If the underlying HTTP connection threw an exception.public long detach()
public void send(ClientStreamElement element)
Connectionsend in class Connectionelement - The element.public String getSessionId()
public String getRoute()
A connection manager MAY be configured to enable sessions with more than one server in different domains. When requesting a session with such a "proxy" connection manager, a client SHOULD include a 'route' attribute that specifies the protocol, hostname, and port of the server with which it wants to communicate, formatted as "proto:host:port" (e.g., "xmpp:example.com:9999").
Copyright © 2014 XMPP.rocks. All rights reserved.