You are reading a single comment by @Gordon and its replies.
Click here to read the full conversation.
-
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 callingsend()
on a dead socket brings obviously nothing
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.