@Override public void onIceConnectionChange(final PeerConnection.IceConnectionState newState) { executor.execute(new Runnable() { @Override public void run() { Log.d(TAG, "IceConnectionState: " + newState); if (newState == IceConnectionState.CONNECTED) { events.onIceConnected(); } else if (newState == IceConnectionState.DISCONNECTED) { events.onIceDisconnected(); } else if (newState == IceConnectionState.FAILED) { reportError("ICE connection failed."); } } }); }
@Override public synchronized void onIceConnectionChange(IceConnectionState newState) { // TODO(bemasc): remove once delivery of ICECompleted is reliable // (https://code.google.com/p/webrtc/issues/detail?id=3021). if (newState.equals(IceConnectionState.COMPLETED)) { return; } if (expectedIceConnectionChanges.isEmpty()) { System.out.println(name + "Got an unexpected ice connection change " + newState); return; } assertEquals(expectedIceConnectionChanges.removeFirst(), newState); }
private static void shutdownPC(PeerConnection pc, ObserverExpectations expectations) { if (expectations.dataChannel != null) { expectations.dataChannel.unregisterObserver(); expectations.dataChannel.dispose(); } expectations.expectStatsCallback(); assertTrue(pc.getStats(expectations, null)); assertTrue(expectations.waitForAllExpectationsToBeSatisfied(TIMEOUT_SECONDS)); expectations.expectIceConnectionChange(IceConnectionState.CLOSED); expectations.expectSignalingChange(SignalingState.CLOSED); pc.close(); assertTrue(expectations.waitForAllExpectationsToBeSatisfied(TIMEOUT_SECONDS)); expectations.expectStatsCallback(); assertTrue(pc.getStats(expectations, null)); assertTrue(expectations.waitForAllExpectationsToBeSatisfied(TIMEOUT_SECONDS)); System.out.println("FYI stats: "); int reportIndex = -1; for (StatsReport[] reports : expectations.takeStatsReports()) { System.out.println(" Report #" + (++reportIndex)); for (int i = 0; i < reports.length; ++i) { System.out.println(" " + reports[i].toString()); } } assertEquals(1, reportIndex); System.out.println("End stats."); pc.dispose(); }
public synchronized void expectIceConnectionChange(IceConnectionState newState) { expectedIceConnectionChanges.add(newState); }
public void onIceConnectionChange(IceConnectionState iceConnectionState) { connectionStateCallback.onConnectionStateChange(iceConnectionState.toString()); }
@Override public void onIceConnectionChange(IceConnectionState arg0) { }
/** * WebRTC event which is triggered when ICE status has changed * @param state The new ICE connection state * @param connection The connection for which this event takes place */ void onIceStatusChanged(IceConnectionState state, NBMPeerConnection connection);
@Override public synchronized void onIceConnectionChange(IceConnectionState newState) { }