socket.readyState


此属性将连接状态表示为字符串。

¥This property represents the state of the connection as a string.

  • 如果流正在连接 socket.readyStateopening

    ¥If the stream is connecting socket.readyState is opening.

  • 如果流可读可写,则为 open

    ¥If the stream is readable and writable, it is open.

  • 如果流可读不可写,则为 readOnly

    ¥If the stream is readable and not writable, it is readOnly.

  • 如果流不可读写,则为 writeOnly

    ¥If the stream is not readable and writable, it is writeOnly.