title: Offer & Answer from same device iOS in WebRTC
body: <p>In Normal Structure, its followed two devices are connected to each other to communicate. </p>
  
  <p>Is it possible to connect same iOS Device to connect itself using WebRTC servers (turn, stun).</p>
  
  <p>What I did So far. </p>
  
  <ol>
  <li><p>Initialized RTCPeerConnectionFactory &amp; setup Peer Connection</p>
  
  <pre><code> [_peerConnection offerForConstraints:constraints
                     completionHandler:^(RTCSessionDescription *sdp,
                                         NSError *error) {
                         NSLog(@"My SDP is %@", sdp);
                         NSLog(@"My Error is %@", error);
  
                         remoteSDP = sdp;
  
                         [self setLocalLocalDescription:sdp];
                         [self setRemoteRemoteDescription:sdp];
  
                     }];
  </code></pre></li>
  <li><p>I received SDP, I set on local description of _peerConnection's setLocalDescription &amp; _peerConnectionremote's setRemoteDescription</p></li>
  <li><p>I prepared Answer from _peerConnectionremote, and I received SDP, which I set _peerConnectionremote's setLocalDescription &amp; _peerConnection's setRemoteDescription.</p></li>
  <li><p>I set Ice candidate in didGenerateIceCandidate, as </p>
  
  <pre><code>if (peerConn == _peerConnection) {
      [_peerConnection addIceCandidate:candidate];
  }else if (peerConn == _peerConnectionremote) {
      [_peerConnectionremote addIceCandidate:candidate];
  }
  </code></pre></li>
  <li><p>I receive remote media stream in </p>
  
  <pre><code>- (void)peerConnection:(RTCPeerConnection *)peerConn
        didAddStream:(RTCMediaStream *)stream , 
  </code></pre></li>
  </ol>
  
  <p>which I set properly.</p>
  
  <p>In last, It says, state as RTCIceConnectionStateConnected, but nothing happens more.</p>
  
  <ol>
  <li><p>Is it possible, two open two streams at the same time from iOS and connect them via WebRTC.</p></li>
  <li><p>If Yes, how can I separate sources </p>
  
  <p>RTCMediaStream* stream1 = [_factory mediaStreamWithStreamId:@"ARDAMS"];
  RTCMediaStream* stream2 = [_factoryremote mediaStreamWithStreamId:@"ARDAMS"];</p></li>
  </ol>
  
  <p>----- For now its stopping first stream even.</p>
  
  <p>Any suggestion or thoughts?</p>
  
  <p>Following this Image as architect, which is working fine with me when one party is remote or other device. But when both parties are same device skipping SIGNALING SERVER, it fails.</p>
  
  <p><a href="https://i.stack.imgur.com/uhonN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uhonN.png" alt="enter image description here"></a></p>