UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[BUG]: Server crashes on client connection

Open ackhia opened this issue 2 years ago • 1 comments

Package version

3.1.0-exp.7

Environment

* OS: Windows 11
* Unity version: 2022.3.4f1
* Graphics API: Auto
* Browser: Chrome

Steps To Reproduce

Create a GameObject with Signaling Manager, Single Connection, Video Stream Receiver, Audio Stream Receiver and Input Sender wired up in the usual way with the Video Stream Receiver rendering to a render texture. Create a script and on button press, run the following code:

var connectionId = System.Guid.NewGuid().ToString("N");
connection.CreateConnection(connectionId);

Current Behavior

The server throws the following exception sometimes:

{ from: 'bd4f667343c94defb955b58aa978b579',
  to: '',
  type: 'answer',
  data:
   { connectionId: 'bd4f667343c94defb955b58aa978b579',
     sdp:
      'v=0\r\no=- 3546602451267332700 3 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 50257 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 43.224.170.151\r\na=candidate:1824183529 1 udp 2122260223 192.168.0.105 50257 typ host generation 0 network-id 1 network-cost 10\r\na=candidate:1840948943 1 udp 1686052607 43.224.170.151 50257 typ srflx raddr 192.168.0.105 rport 50257 generation 0 network-id 1 network-cost 10\r\na=candidate:309671537 1 tcp 1518280447 192.168.0.105 55274 typ host tcptype passive generation 0 network-id 1 network-cost 10\r\na=ice-ufrag:KGge\r\na=ice-pwd:obanPS/6Rpg8TRt7VsnbXvo0\r\na=ice-options:trickle\r\na=fingerprint:sha-256 90:2C:A1:47:8E:74:6C:66:1B:39:38:A5:84:F2:43:73:6F:9F:0C:7C:01:E2:15:2A:68:00:A0:DE:AB:5D:49:C0\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n',
     type: 'answer',
     polite: false } }
C:\snapshot\WebApp\node_modules\ws\lib\event-target.js:199
        listener.call(this, event);
                 ^

TypeError: Cannot read property 'send' of null
    at Object.onAnswer (C:\snapshot\WebApp\build\class\websockethandler.js:0:0)
    at WebSocket.WSSignaling.WSSignaling.wss.on.ws.onmessage (C:\snapshot\WebApp\build\websocket.js:0:0)
    at WebSocket.onMessage (C:\snapshot\WebApp\node_modules\ws\lib\event-target.js:199:18)
    at WebSocket.emit (events.js:198:13)
    at Receiver.receiverOnMessage (C:\snapshot\WebApp\node_modules\ws\lib\websocket.js:1178:20)
    at Receiver.emit (events.js:198:13)
    at Receiver.dataMessage (C:\snapshot\WebApp\node_modules\ws\lib\receiver.js:528:14)
    at Receiver.getData (C:\snapshot\WebApp\node_modules\ws\lib\receiver.js:446:17)
    at Receiver.startLoop (C:\snapshot\WebApp\node_modules\ws\lib\receiver.js:148:22)
    at Receiver._write (C:\snapshot\WebApp\node_modules\ws\lib\receiver.js:83:10)

Expected Behavior

Video to be received from the sender

Anything else?

This only happens sometimes and I can't figure out why. I also have a GameObject that transmits video in the project although this has not been Start()'ed so should not have any effect. I also see this issue if I use Firefox to receive the video instead of Chrome.

ackhia avatar Nov 23 '23 04:11 ackhia

memo: URS-632

karasusan avatar Nov 24 '23 05:11 karasusan