本文整理匯總了Java中org.jivesoftware.smack.tcp.XMPPTCPConnection.disconnect方法的典型用法代碼示例。如果您正苦於以下問題:Java XMPPTCPConnection.disconnect方法的具體用法?Java XMPPTCPConnection.disconnect怎麽用?Java XMPPTCPConnection.disconnect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jivesoftware.smack.tcp.XMPPTCPConnection
的用法示例。
在下文中一共展示了XMPPTCPConnection.disconnect方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: reallyClose
import org.jivesoftware.smack.tcp.XMPPTCPConnection; //導入方法依賴的package包/類
/**
* 真正關閉連線
*/
public synchronized void reallyClose() {
try {
if (delegate != null) {
if (delegate instanceof XMPPTCPConnection) {
XMPPTCPConnection conn = (XMPPTCPConnection) delegate;
conn.disconnect();
// 移除所有的listener
removeAllListeners(conn);
}
}
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
示例2: createXMPPConnection
import org.jivesoftware.smack.tcp.XMPPTCPConnection; //導入方法依賴的package包/類
@Test
@BenchmarkOptions(benchmarkRounds = 10, warmupRounds = 0, concurrency = 10)
// round: 0.40 [+- 0.00], round.block: 0.05 [+- 0.01], round.gc: 0.00 [+-
// 0.00], GC.calls: 1, GC.time: 0.01, time.total: 0.41, time.warmup: 0.00,
// time.bench: 0.41
public void createXMPPConnection() throws Exception {
XMPPConnection result = null;
result = factory.createXMPPConnection();
System.out.println(result);
assertNotNull(result);
//
XMPPTCPConnection conn = (XMPPTCPConnection) result;
conn.disconnect();
}
示例3: disconnectAndUnmanage
import org.jivesoftware.smack.tcp.XMPPTCPConnection; //導入方法依賴的package包/類
public void disconnectAndUnmanage(XMPPTCPConnection connection) {
connection.disconnect();
synchronized (mManagedConnections) {
mManagedConnections.remove(connection);
}
}