You are reading a single comment by @Injecteer and its replies. Click here to read the full conversation.
  • What device are you running this on?

    It's possible that it's because you're using send right away. new WebSocket won't be blocking, so it's possible it's not even connected when you're trying to send.

  • Thanks for your reply Gordon!

    I'm on esp8266.

    I called ws.initializeConnection(); in the left console, after I sent the code to device. It brought me the following console out:

        RAW: HTTP/1.1 101 Switching Protocols
        Upgrade: websocket
        Connection: Upgrade
        Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=
        Handshake Success
        Connection closed
    

    so, the ws is in closed state immediately after initializing, and calling send() on a dead socket brings obviously nothing

About

Avatar for Injecteer @Injecteer started