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
1 changed files with 6 additions and 2 deletions

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