本文整理汇总了Java中org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer.setResponseTimeout方法的典型用法代码示例。如果您正苦于以下问题:Java OutgoingFileTransfer.setResponseTimeout方法的具体用法?Java OutgoingFileTransfer.setResponseTimeout怎么用?Java OutgoingFileTransfer.setResponseTimeout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer
的用法示例。
在下文中一共展示了OutgoingFileTransfer.setResponseTimeout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: commit
import org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer; //导入方法依赖的package包/类
public void commit() {
LocalPreferences pref = SettingsManager.getLocalPreferences();
String downloadDir = ui.getDownloadDirectory();
if (ModelUtil.hasLength(downloadDir)) {
pref.setDownloadDir(downloadDir);
}
String timeout = ui.getTimeout();
if (ModelUtil.hasLength(timeout)) {
int tout = 1;
try {
tout = Integer.parseInt(timeout);
} catch (NumberFormatException e) {
// Nothing to do
}
pref.setFileTransferTimeout(tout);
final int timeOutMs = tout * (60 * 1000);
OutgoingFileTransfer.setResponseTimeout(timeOutMs);
}
SettingsManager.saveSettings();
}
示例2: OutgoingTransfersManager
import org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer; //导入方法依赖的package包/类
/**
* Default constructor. Initialize fields and sets the default detection
* time of an outgoing file transfer.
*
* @param maxOut maximum number of simultaneous outgoing file transfers
*/
public OutgoingTransfersManager( FileTransferManager manager, int maxOut, int responseTimeout, ReentrantLock transfersLock) {
this.maxOut = maxOut;
transfers = new ConcurrentHashMap<TransferHandle,OutgoingTransfer>();
this.transfersLock = transfersLock;
queuedTransfers = new LinkedList<OutgoingTransfer>();
// Setting negotiation timeout
OutgoingFileTransfer.setResponseTimeout( responseTimeout );
this.manager = manager;
transferStateMonitor = new TransferStateMonitorThread();
}
示例3: FileTransferPreference
import org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer; //导入方法依赖的package包/类
public FileTransferPreference() {
localPreferences = SettingsManager.getLocalPreferences();
int timeout = localPreferences.getFileTransferTimeout();
timeout = timeout * 60 * 1000;
OutgoingFileTransfer.setResponseTimeout(timeout);
ui = new FileTransferPreferencePanel();
}