shinyoshiaki / werift-webrtc

WebRTC Implementation for TypeScript (Node.js), includes ICE/DTLS/SCTP/RTP/SRTP/WEBM/MP4
MIT License
469 stars 30 forks source link

parallelize stun/turn handling. fix turn error causing negotiation failure #323

Closed koush closed 1 year ago

koush commented 1 year ago

the main issue I am fixing was any turn server exception causing getComponentCandidates to fail completely. then I noticed that there was an opportunity to parallelize how srflx and relay candidates are fetched. right now they happen in a serialized fashion.

scrypted  | unhandledRejection TypeError: Cannot read properties of undefined (reading 'getAttributeValue')
scrypted  |     at b.connectionMade [as connect] (/external/werift/packages/ice/src/turn/protocol.ts:165:22)
scrypted  |     at protocol (/external/werift/packages/ice/src/turn/protocol.ts:318:20)
scrypted  |     at t.Connection.candidates [as getComponentCandidates] (/external/werift/packages/ice/src/ice.ts:206:13)
scrypted  |     at t.Connection.gatherCandidates (/external/werift/packages/ice/src/ice.ts:112:15)
scrypted  |     at t.RTCIceGatherer.gather (/external/werift/packages/webrtc/src/transport/ice.ts:128:21)
scrypted  |     at async Promise.all (index 0)
scrypted  |     at I.setRemoteDescription (/external/werift/packages/webrtc/src/peerConnection.ts:978:33)
scrypted  |
scrypted  | e WebRTC Plugin unhandledRejection TypeError: Cannot read properties of undefined (reading 'getAttributeValue')
shinyoshiaki commented 1 year ago

thanks