EricssonResearch / openwebrtc

A cross-platform WebRTC client framework based on GStreamer
http://www.openwebrtc.org
BSD 2-Clause "Simplified" License
1.8k stars 537 forks source link

after reset OpenWebRTC the ICE still try to connection to peer in background. #579

Open xelven opened 8 years ago

xelven commented 8 years ago

I think there have other issue relate to libNice, Since I try to figure out the root cause of my posted issue, ref: https://github.com/EricssonResearch/openwebrtc/issues/575

so I enable the G_MESSAGES_DEBUG & NICE_DEBUG to all.

but I found if the connection has connected one once, then hangup by UI drive to reset() OpenWebRTCHandle from iOS-SDK, then as the NICE_DEBUG log are still try to connecting peer all the time.

here is the info of the pair candidate

pair Local_Candidate No.0 NiceCandidateType: CANDIDATE_TYPE_RELAY,NiceCandidateTransport: TRANSPORT_TYPE_UDP,addr: 54.178.56.14,port: 59166,base_addr: 2409:8894:8030:5ede:1083:c11a:3168:bef2,base_port: 0,priority: 167772671, stream_id: 1, component_id: 1,username: (null),password:(null), 
NO TURN

pair Remote_Candidate No.0 NiceCandidateType: CANDIDATE_TYPE_SERVER_REFLEXIVE,NiceCandidateTransport: TRANSPORT_TYPE_UDP,addr: 116.226.127.167,port:64532, base_addr: ,base_port: 0, priority: 1686052607, stream_id: 1, component_id: 1,username: 9lnGyQnDBtbiBlYG,password:JZX1vDi9f673ZNhKLzKlY83b, 
NO TURN

here the log from NICE_DEBUG

(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1
(<unknown>:6057): libnice-DEBUG: Agent 0x1547b000 : s1:1: sending 1 messages to [116.226.127.167]:64532
(<unknown>:6057): libnice-DEBUG: nice_agent_send_messages_nonblocking_internal: n_sent: -1, n_messages: 1

I would like take look whats wrong between OpenWebRTC and LibNice, so let discuss on this. I plan make an example for NICE first, and then take look it from OpenWebRTC.

if some one has been experience on libNice, please let's talk!

xelven commented 8 years ago

well, I think I got it, this is the bug in OWR, as the document of Nice, there function called nice_agent_add_stream by add session, But there nobody call nice_agent_remove_stream, nobody.

xelven commented 8 years ago

Just tried, and it works. No more connection running in background after reset. done.

stefhak commented 8 years ago

Hi Allen,

would you be willing to provide a Pull Request to fix this in OWR so that others can benefit?

Thanks, Stefan

On Tue, Mar 8, 2016 at 7:01 AM, Allen Chan notifications@github.com wrote:

Just tried, and it works. No more connection running in background after reset. done.

— Reply to this email directly or view it on GitHub https://github.com/EricssonResearch/openwebrtc/issues/579#issuecomment-193620427 .

stefanalund commented 8 years ago

@xelven nice detective work :smiley: Please provide a PR if you get the chance. Thanks!

xelven commented 8 years ago

wrong click... yeah, I will do it