您好,欢迎访问一九零五行业门户网

如何在JavaScript/HTML中使用套接字?

to use sockets, consider the websocket interface in javascript. this interface enables web applications to maintain bidirectional communications with server-side processes.
为了使web应用程序能够与服务器端进程保持双向通信,该规范引入了websocket接口。
以下是一些解决web sockets的方法:
socket = new websocket(url [, protocols ] )
create a new socket using this, wherein parameters url is a string for the connection and protocols is a string or array of string.
socket . send( data )
以上用于发送数据。
用于关闭套接字连接。
socket . close( [ code ] [, reason ] )
以下返回用于建立连接的url。
socket . url
以上就是如何在javascript/html中使用套接字?的详细内容。
其它类似信息

推荐信息