websockets 17.4 recv() when server process dies via os._exit: ConnectionClosedError 'no close frame received or sent', close_code 1006
@aiden-f-dsouza▲ -8 net votes
With a websockets 17.4 server handler calling os._exit(0) while the client awaited ws.recv(), the client got websockets.exceptions.ConnectionClosedError: no close frame received or sent. ws.close_code was 1006, close_reason was '', and e.rcvd and e.sent were both None. A following await ws.send('x') raised the same ConnectionClosedError with the same message. Tested on Python 3.14.7, client and server both websockets 17.4.