for (Candidate candidate : iceNegociator.getSortedCandidates()) try { Candidate.CandidateType type = candidate.getCandidateType(); ICECandidate.Type iceType; if (type.equals(Candidate.CandidateType.ServerReflexive)) Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces(); short i = 0; NetworkInterface nic = NetworkInterface.getByInetAddress(candidate.getAddress().getInetAddress()); while (nics.hasMoreElements()) { NetworkInterface checkNIC = nics.nextElement(); TransportCandidate transportCandidate = new ICECandidate(candidate.getAddress().getInetAddress().getHostAddress(), 1, nicNum, String.valueOf(random.nextInt(Integer.MAX_VALUE)), candidate.getPort(), "1", candidate.getPriority(), iceType); transportCandidate.setLocalIp(candidate.getBase().getAddress().getInetAddress().getHostAddress()); transportCandidate.setPort(getFreePort()); try { LOGGER.fine("Candidate addr: " + candidate.getAddress().getInetAddress() + "|" + candidate.getBase().getAddress().getInetAddress() + " Priority:" + candidate.getPriority());
while (iterCandidates.hasNext()) { Candidate cand = iterCandidates.next(); CandidateType type = cand.getCandidateType(); if (type == CandidateType.Local) numberLocal++; else if (type == CandidateType.ServerReflexive) numberServerReflexive++; int componentValue = 0; Candidate cand = iterCandidates.next(); CandidateType type = cand.getCandidateType(); if (type == CandidateType.Local) { typeValue = LOCAL_PREFERENCE; localValue = numberRelayed--; componentValue = cand.getComponentId(); int priority = ((2 ^ 24) * typeValue) + ((2 ^ 8) * localValue) + componentValue; cand.setPriority(priority);
public int compareTo(Object arg0) { Candidate cand = (Candidate) arg0; return cand.getPriority() - getPriority(); }
try { Candidate local = new Candidate(new Address(iaddress.getAddress()), componentId); candidates.add(local); DiscoveryInfo di = test.test(); if (di.getPublicIP() != null) { Candidate cand = new Candidate(new Address(di.getPublicIP().getAddress()), CandidateType.ServerReflexive, componentId, local); cand.setComponentId(componentId); candidates.add(cand);
public boolean equals(Object o) { if (o == null) return false; if ((((Candidate) o).socket.equals(socket)) && (((Candidate) o).base.equals(base))) return true; return false; } }
while (iterCandidates.hasNext()) { Candidate cand = iterCandidates.next(); CandidateType type = cand.getCandidateType(); if (type == CandidateType.Local) numberLocal++; else if (type == CandidateType.ServerReflexive) numberServerReflexive++; int componentValue = 0; Candidate cand = iterCandidates.next(); CandidateType type = cand.getCandidateType(); if (type == CandidateType.Local) { typeValue = LOCAL_PREFERENCE; localValue = numberRelayed--; componentValue = cand.getComponentId(); int priority = ((2 ^ 24) * typeValue) + ((2 ^ 8) * localValue) + componentValue; cand.setPriority(priority);
public int compareTo(Object arg0) { Candidate cand = (Candidate) arg0; return cand.getPriority() - getPriority(); }
try { Candidate local = new Candidate(new Address(iaddress.getAddress()), componentId); candidates.add(local); DiscoveryInfo di = test.test(); if (di.getPublicIP() != null) { Candidate cand = new Candidate(new Address(di.getPublicIP().getAddress()), CandidateType.ServerReflexive, componentId, local); cand.setComponentId(componentId); candidates.add(cand);
public boolean equals(Object o) { if (o == null) return false; if ((((Candidate) o).socket.equals(socket)) && (((Candidate) o).base.equals(base))) return true; return false; } }
for (Candidate candidate : iceNegociator.getSortedCandidates()) try { Candidate.CandidateType type = candidate.getCandidateType(); ICECandidate.Type iceType = ICECandidate.Type.local; if (type.equals(Candidate.CandidateType.ServerReflexive)) Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces(); short i = 0; NetworkInterface nic = NetworkInterface.getByInetAddress(candidate.getAddress().getInetAddress()); while(nics.hasMoreElements()) { NetworkInterface checkNIC = nics.nextElement(); TransportCandidate transportCandidate = new ICECandidate(candidate.getAddress().getInetAddress().getHostAddress(), 1, nicNum, String.valueOf(Math.abs(random.nextLong())), candidate.getPort(), "1", candidate.getPriority(), iceType); transportCandidate.setLocalIp(candidate.getBase().getAddress().getInetAddress().getHostAddress()); transportCandidate.setPort(getFreePort()); try { LOGGER.debug("Candidate addr: " + candidate.getAddress().getInetAddress() + "|" + candidate.getBase().getAddress().getInetAddress() + " Priority:" + candidate.getPriority());
for (Candidate candidate : iceNegociator.getSortedCandidates()) try { Candidate.CandidateType type = candidate.getCandidateType(); ICECandidate.Type iceType = ICECandidate.Type.local; if (type.equals(Candidate.CandidateType.ServerReflexive)) Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces(); short i = 0; NetworkInterface nic = NetworkInterface.getByInetAddress(candidate.getAddress().getInetAddress()); while(nics.hasMoreElements()) { NetworkInterface checkNIC = nics.nextElement(); TransportCandidate transportCandidate = new ICECandidate(candidate.getAddress().getInetAddress().getHostAddress(), 1, nicNum, String.valueOf(Math.abs(random.nextLong())), candidate.getPort(), "1", candidate.getPriority(), iceType); transportCandidate.setLocalIp(candidate.getBase().getAddress().getInetAddress().getHostAddress()); transportCandidate.setPort(getFreePort()); try { LOGGER.fine("Candidate addr: " + candidate.getAddress().getInetAddress() + "|" + candidate.getBase().getAddress().getInetAddress() + " Priority:" + candidate.getPriority());