srs icon indicating copy to clipboard operation
srs copied to clipboard

webrtc over tcp (tcp connection was frequently disconnected )

Open gavin88 opened this issue 2 years ago • 2 comments

Description

In the process of using webrtc over tcp. we found that the tcp connection was frequently disconnected during an irregular periods of time. The server seems to destroy the rtc session without giving the client a chance to reconnect.

  1. SRS Version: SRS/5.0.170(Bee)

  2. SRS Log:

[2023-08-17 13:17:48.345][INFO][1][23gh7t50] TCP: before dispose resource(Tcp)(0x60c000027d00), conns=5, zombies=0, ign=0, inz=0, ind=0
[31m[2023-08-17 13:17:48.345][ERROR][1][q5ln2h46][0] serve error code=1070(StThreadInterrupt)(ST thread is interrupted) : rtc tcp conn : interrupted
thread [1][q5ln2h46]: do_cycle() [./src/app/srs_app_rtc_network.cpp:811][errno=0]
thread [1][q5ln2h46]: interrupt() [./src/app/srs_app_st.cpp:257][errno=0]

Additional error log, It may not be the core error log, it may be just a normal prompt.

[2023-08-17 12:34:27.173][ERROR][1][q8b9918f][11] serve error code=5035(RtcUnique)(RTC only support one UDP or TCP network) : process rtc tcp pkt : only support one network
thread [1][q8b9918f]: do_cycle() [./src/app/srs_app_rtc_network.cpp:805][errno=11]
thread [1][q8b9918f]: handshake() [./src/app/srs_app_rtc_network.cpp:867][errno=11](Resource temporarily unavailable)
[31m[2023-08-17 13:19:33.442][ERROR][1][23gh7t50][11] serve error code=5034(RtcTcpSession)(RTC TCP packet is invalid for session not found) : process rtc tcp pkt : no session, stun username=nr555r47:A+It
thread [1][23gh7t50]: do_cycle() [./src/app/srs_app_rtc_network.cpp:805][errno=11]
thread [1][23gh7t50]: handshake() [./src/app/srs_app_rtc_network.cpp:853][errno=11](Resource temporarily unavailable)
  1. SRS Config:
rtc_server {
    enabled         on;
    listen 19000; 
    tcp {
        enabled on;
        listen 19000;
    }
    protocol tcp;
    candidate   xx.xx.xx.xx;
}

Replay

Step 1: webrtc over tcp streaming normally

Step 2: switch the network

Step 3: the connnection is disconnected and the stream needs to be republish.

Expect

Hope to be able to use webrtc over tcp for stable communication.

gavin88 avatar Aug 18 '23 12:08 gavin88

me too

yiippee avatar Sep 17 '23 10:09 yiippee

I got the error when I use the same TCP port for API and webRTC

Li20230828 avatar Nov 01 '23 07:11 Li20230828

Duplicated to #3784

winlinvip avatar Mar 30 '24 23:03 winlinvip