// Create a packet collector to listen for a response.
PacketCollector collector = connection
.createPacketCollector(new PacketIDFilter(id));
StopWatch watch = new StopWatch().start();
try {
try {
progress.subTask("Sending Data");
dataTransferManager.sendData(transferData, testData,
progress.newChild(40));
} catch (IOException e) {
throw new XMPPException("IOException sending data", e);
} catch (SarosCancellationException e) {
throw new XMPPException(
"CancellationException sending data", e);
}
progress.subTask("Waiting for reply");
ConnectionTestResponse response = null;
for (int i = 0; i < 15; i++) {
response = responseProvider.getPayload(collector
.nextResult(1000));
if (response != null)
break;
progress.worked(1);
}
result.transferTime = watch.stop().getTime();
if (response == null)
throw new XMPPException("Timeout after 15s");
if (response.errorMessage != null)