Remove non necessary check from WebSocket send function.

Peer connection may generate answer and ICE candidates before
websocket client is registered. Remove check from sendAnswer()
and sendLocalIceCandidate() functions and allow websocket client
to accumulate messages and send them later once it will be
registered.

R=wzh@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/44379004

Cr-Commit-Position: refs/heads/master@{#8508}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8508 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
glaznev@webrtc.org 2015-02-25 19:18:29 +00:00
parent f09e7b8a4f
commit b5e60b6ca7

View File

@ -233,10 +233,6 @@ public class WebSocketRTCClient implements AppRTCClient,
Log.e(TAG, "Sending answer in loopback mode.");
return;
}
if (wsClient.getState() != WebSocketConnectionState.REGISTERED) {
reportError("Sending answer SDP in non registered state.");
return;
}
JSONObject json = new JSONObject();
jsonPut(json, "sdp", sdp.description);
jsonPut(json, "type", "answer");
@ -268,10 +264,6 @@ public class WebSocketRTCClient implements AppRTCClient,
}
} else {
// Call receiver sends ice candidates to websocket server.
if (wsClient.getState() != WebSocketConnectionState.REGISTERED) {
reportError("Sending ICE candidate in non registered state.");
return;
}
wsClient.send(json.toString());
}
}