本文整理汇总了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);
}
}