1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-25 20:18:00 +01:00

Change return value of connectToCandidates

This commit is contained in:
vanitasvitae 2017-07-21 18:31:42 +02:00
parent 19d334d6bb
commit a77360d060
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -100,14 +100,18 @@ public class JingleS5BTransport extends Transport<JingleS5BTransportElement> {
}
public void connectToCandidates(int timeout) {
public JingleS5BTransportCandidate connectToCandidates(int timeout) {
for (TransportCandidate c : getCandidates()) {
int _timeout = timeout / getCandidates().size(); //TODO: Wise?
try {
selectedCandidate = ((JingleS5BTransportCandidate) c).connect(timeout / getCandidates().size()); //TODO: Wise?
return ((JingleS5BTransportCandidate) c).connect(_timeout);
} catch (IOException | TimeoutException | InterruptedException | SmackException | XMPPException e) {
e.printStackTrace();
}
}
// Failed to connect to any candidate.
return null;
}
@Override