web套接字属性readyState webSocket的readyState属性用来定义连接状态,该属性的值有下面几种:
0 :支持常数连接(numeric value0),
正在建立连接。 还没有完成。 theconnectionhasnotyetbeenestablished。
1 :对应常数open(numericvalue1),
连接正常建立,可以进行通信。 thewebsocketconnectionisestablishedandcommunicationispossible。
2 :支持常数closing(numericvalue2)
连接是闭合的握手。 马上就要关闭了。 theconnectionisgoingthroughtheclosinghandshake。
3支持3 :常数关闭(numeric value3)
连接已关闭或根本没有建立。 theconnectionhasbeenclosedorcouldnotbeopened。
转自: https://www.cn blogs.com/Scott-j/p/9306197.html