当前位置: 首页>>代码示例>>Java>>正文


Java OutgoingFileTransfer.setResponseTimeout方法代码示例

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

}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:27,代码来源:FileTransferPreference.java

示例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();
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:18,代码来源:OutgoingTransfersManager.java

示例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();
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:11,代码来源:FileTransferPreference.java


注:本文中的org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer.setResponseTimeout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。