godotengine / godotengine/godot
`WebSocketPeer.put_packet()` fails with no error printed when the socket is disconnected
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in the 4.3-stable.
### System information
Ubuntu 22.04, 4.3-stable
### Issue description
WebSocketPeer.get_ready_state returns 1 when the socket is actually disconnected.
WebSocketPeer.put_packet puts packets into the void with no indication that something went wrong.
IIRC, this is not how websockets are supposed to work.
### Steps to reproduce
```gdscript
var socket = WebSocketPeer.new()
socket.connect_to_url(secure_url)
... wait for it to connect, then pull the cable
socket.poll()
socket.get_ready_state() # this returns 1
socket.put_packet(packet) # this doesn't report anything either
```
### Minimal reproduction project (MRP)
N/A
Contributor guide
Assessment
This issue has not been assessed yet.