iOS Development

swift – iOS webRTC ICE candidates – allow energetic tcptype?

Spread the love


My WebRTC connection isn’t getting established. When producing my ICE candidates on my iPhone by way of the WebRTC library in Swift, I obtain tcptype passive on all of them. In a JavaScript model of my code I can generate ICE candidates with tcptype energetic and right here the connection is getting established efficiently.

My ICE Candidates with tcptype passive:

a=candidate:3360112390 1 tcp 1518280447 192.168.100.232 58625 typ host tcptype passive era 0 ufrag e9vc network-id 1 network-cost 10
a=candidate:2350357220 1 tcp 1518214911 169.254.254.183 58626 typ host tcptype passive era 0 ufrag e9vc network-id 2 network-cost 10
a=candidate:122524574 1 tcp 1518018303 10.134.230.124 58627 typ host tcptype passive era 0 ufrag e9vc network-id 7 network-cost 900
a=candidate:23006574 1 tcp 1518151935 2a02:3032:305:edcb:e809:26f9:efe7:4032 58628 typ host tcptype passive era 0 ufrag e9vc network-id 8 network-cost 900
a=candidate:1316923671 1 tcp 1518086399 2a02:303e:2b17:3f50:599f:f17:bf24:5bbc 58629 typ host tcptype passive era 0 ufrag e9vc network-id 9 network-cost 900
a=candidate:990886995 1 tcp 1517957887 fdfe:f2d:3c26::1 58630 typ host tcptype passive era 0 ufrag e9vc network-id 10 network-cost 50
a=candidate:1461496119 1 tcp 1517889791 2a02:303e:2b17:3f50:1825:7933:ec1f:af3b 58631 typ host tcptype passive era 0 ufrag e9vc network-id 3 network-cost 50
a=candidate:1461496119 1 tcp 1517824255 2a02:303e:2b17:3f50:1825:7933:ec1f:af3b 58632 typ host tcptype passive era 0 ufrag e9vc network-id 4 network-cost 50
a=candidate:388287157 1 udp 1686052607 176.95.203.239 52871 typ srflx raddr 192.168.100.232 rport 52871 era 0 ufrag e9vc network-id 1 network-cost 10
a=candidate:2217923902 1 udp 1685790463 176.0.150.230 32375 typ srflx raddr 10.134.230.124 rport 61138 era 0 ufrag e9vc network-id 7 network-cost 900

Can I in some way set this parameter in my peer connection’s config or elsewhere?

I take advantage of a typical config to date for my peer connection:

let config = RTCConfiguration()
config.iceServers = [RTCIceServer(urlStrings: ["stun:stun.l.google.com:19302"])]
config.sdpSemantics = .unifiedPlan
         
let constraints = RTCMediaConstraints(mandatoryConstraints: nil,
                                              optionalConstraints: ["DtlsSrtpKeyAgreement":kRTCMediaConstraintsValueTrue])
        
let peerConnection = manufacturing unit.peerConnection(with: config, 
     constraints: constraints, delegate: nil)

Reference to the tcptye documentation

2 thoughts on “swift – iOS webRTC ICE candidates – allow energetic tcptype?

  1. Fantastic site Lots of helpful information here I am sending it to some friends ans additionally sharing in delicious And of course thanks for your effort

Leave a Reply

Your email address will not be published. Required fields are marked *