PreadyState
Bun

property

Socket.readyState

readonly readyState: -2 | -1 | 0 | 1 | 2

The ready state of the socket.

You can assume that a positive value means the socket is open and usable

  • -2 = Shutdown
  • -1 = Detached
  • 0 = Closed
  • 1 = Established
  • 2 = Else