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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

WebGL error websocket....

Discussion in 'Multiplayer' started by sonxoans2, Sep 13, 2016.

  1. sonxoans2

    sonxoans2

    Joined:
    Apr 17, 2015
    Posts:
    25
    HELP ME....
    When i use jonas-echterhoff plugin (http://files.unity3d.com/jonas/WebSockets.unitypackage) run by webgl with https. I got error:
    "UnityLoader.js:1 exception thrown: InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.,Error: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
    at Error (native)
    at _SocketSend (blob:https://my-domain/e6a706ca-1e7d-4ab7-a2b4-cb2346e99d32:1:215725)
    at rlf (blob:https://my-domain/e6a706ca-1e7d-4ab7-a2b4-cb2346e99d32:18:265350)
    at Array.mlf (blob:https://my-domain/e6a706ca-1e7d-4ab7-a2b4-cb2346e99d32:18:264619)
    at Object.$qm [as dynCall_viii] (blob:https://my-domain/e6a706ca-1e7d-4ab7-a2b4-cb2346e99d32:8:1165350)
    at invoke_viii (blob:https://my-domain/e6a706ca-1e7d-4ab7-a2b4-cb2346e99d32:1:363899)
    at FDf (blob:https://my-domain/e6a706ca-1e7d-4ab7-a2b4-cb2346e99d32:18:687227)
    at Array.Xvf (blob:https://my-domain/e6a706ca-1e7d-4ab7-a2b4-cb2346e99d32:18:491853)
    at Array.sql (blob:https://my-domain/e6a706ca-1e7d-4ab7-a2b4-cb2346e99d32:8:236214)
    at Object.Drm [as dynCall_iiii] (blob:https://my-domain/e6a706ca-1e7d-4ab7-a2b4-cb2346e99d32:8:1169069)Module.printErr @ UnityLoader.js:1
    UnityLoader.js:1 Invoking error handler due to
    Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state."

    somebody tell me how to fix this, please...
     
    Last edited: Sep 13, 2016
  2. iileychen

    iileychen

    Joined:
    Oct 13, 2015
    Posts:
    96
    Wait after yourSocket.state == CONNECTED
    then call send() will fix this issue.
     
  3. sonxoans2

    sonxoans2

    Joined:
    Apr 17, 2015
    Posts:
    25
    Thank you for reply...
    I got new error:
    WebSocket connection to 'wss://choibaidoithuong.org:4326/' failed: Error in connection establishment: net::ERR_TIMED_OUT
    somebody tell me how to fix this, please...