Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Question Server crashes

Discussion in 'Unity Render Streaming' started by SBV, Jun 21, 2023.

  1. SBV

    SBV

    Joined:
    Jun 3, 2020
    Posts:
    21
    Good afternoon. I have the following task.
    One Unity subscriber has the following components:
    BroadCast
    AudioStreamSender
    VideoStreamSender
    AudioStreamReceiver
    VideoStreamReceiver
    InputReceiver

    The second Unity subscriber has the following components:
    SingleConnection
    AudioStreamSender
    VideoStreamSender
    AudioStreamReceiver
    VideoStreamReceiver
    InputSender

    The server crashes with this message on connection:
    WebApp\UnityRenderStreaming-main\WebApp\build\class\websockethandler.js:117
    otherSessionWs.send(JSON.stringify({ from: connectionId, to: "", type: "answer", data: newAnswer }))
    ^

    TypeError: Cannot read properties of null (read 'send')
    at Object.onAnswer (C:\Users\buzakin\Desktop\WebApp\UnityRenderStreaming-main\WebApp\build\class\websockethandler.js:117:20)
    at ws.onmessage (C:\Users\buzakin\Desktop\WebApp\UnityRenderStreaming-main\WebApp\build\websocket.js:39:33)
    at WebSocket.onMessage (C:\Users\buzakin\Desktop\WebApp\UnityRenderStreaming-main\WebApp\node_modules\ws\lib\event-target.js:199:18)
    at WebSocket.emit (node:events:513:28)
    at Receiver.receiverOnMessage (C:\Users\buzakin\Desktop\WebApp\UnityRenderStreaming-main\WebApp\node_modules\ws\lib\websocket.js:1178:20)
    at Receiver.emit (node:events:513:28)
    at Receiver.dataMessage (C:\Users\buzakin\Desktop\WebApp\UnityRenderStreaming-main\WebApp\node_modules\ws\lib\receiver.js:528:14)
    at Receiver.getData (C:\Users\buzakin\Desktop\WebApp\UnityRenderStreaming-main\WebApp\node_modules\ws\lib\receiver.js:446:17)
    at Receiver.startLoop (C:\Users\buzakin\Desktop\WebApp\UnityRenderStreaming-main\WebApp\node_modules\ws\lib\receiver.js:148:22)
    at Receiver._write (C:\Users\buzakin\Desktop\WebApp\UnityRenderStreaming-main\WebApp\node_modules\ws\lib\receiver.js:83:10)

    When I remove the AudioStreamSender component from the second subscriber. Everything is ok!!!
    How can I solve this problem?
     
  2. kannan-xiao4

    kannan-xiao4

    Unity Technologies

    Joined:
    Nov 5, 2020
    Posts:
    76
    That's strange.
    Looking only at the error log, it seems that the problem occurred because the SecondSubscriber side was disconnected.

    Can you also provide the logs for each of the Unity Subscriber1 and 2?
    And please describe your environment.(Unity version, package version, OS etc..)
     
    Last edited: Jun 29, 2023
  3. SBV

    SBV

    Joined:
    Jun 3, 2020
    Posts:
    21
    My environment:
    Unity 2021.3.15f1
    Windows 10 Pro
    RenderStreaming 3.1.0-exp.5.

    Yes! Weird. The error occurs when the subscriber in
    [SerializeField] private List<Component> streams = new List<Component>();
    the components are in this order:
    AudioStreamReceiver
    VideoStreamReceiver
    AudioStreamSender
    VideoStreamSender
    InputSender.

    This is the order in which everything works perfectly:
    AudioStreamSender
    VideoStreamSender
    AudioStreamReceiver
    VideoStreamReceiver
     
  4. kannan-xiao4

    kannan-xiao4

    Unity Technologies

    Joined:
    Nov 5, 2020
    Posts:
    76
    Can you also provide Editor logs for each of the Unity Subscriber1 and 2?