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:
parent
19d334d6bb
commit
a77360d060
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue