锘??xml version="1.0" encoding="utf-8" standalone="yes"?>97久久精品人妻人人搡人人玩,99精品伊人久久久大香线蕉,99久久精品免费看国产一区二区三区http://www.shnenglu.com/Error/category/21182.htmlzh-cnMon, 22 Feb 2016 09:56:34 GMTMon, 22 Feb 2016 09:56:34 GMT60websocket 綆浠?/title><link>http://www.shnenglu.com/Error/archive/2016/02/22/212860.html</link><dc:creator>Enic</dc:creator><author>Enic</author><pubDate>Mon, 22 Feb 2016 09:02:00 GMT</pubDate><guid>http://www.shnenglu.com/Error/archive/2016/02/22/212860.html</guid><wfw:comment>http://www.shnenglu.com/Error/comments/212860.html</wfw:comment><comments>http://www.shnenglu.com/Error/archive/2016/02/22/212860.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Error/comments/commentRss/212860.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Error/services/trackbacks/212860.html</trackback:ping><description><![CDATA[<p>WebSocket is an underlying network protocol that enables you to build other standard<br />protocols on top of it.</p> <p>The WebSocket Protocol enables full duplex communication between a client and<br />a remote server over the Web, and supports transmission of binary data and text strings.<br />The protocol consists of an opening handshake followed by basic message framing, and is<br />layered over TCP.</p> <p><br />WebSocket programming follows an asynchronous programming model, which<br />means that as long as a WebSocket connection is open, your application simply listens<br />for events. Your client does not need to actively poll the server for more information. To<br />start listening for the events, you simply add callback functions to the WebSocket object.<br />Alternatively, you can use the addEventListener() DOM method to add event listeners<br />to your WebSocket objects.<br />A WebSocket object dispatches four different events:<br />· Open<br />· Message<br />· Error<br />· Close<br />As with all web APIs, you can listen for these events using on<eventname> handler<br />properties, as well as using the addEventListener(); method.</p> <p>ws.onopen<br />ws.onmessage<br />ws.onerror<br />ws.onclose</p> <p>e.data instanceof Blob<br />ws.binaryType = "blob"</p> <p>WebSocket objects have two methods: send() and close()</p> <p><br />Listing 2-12. Waiting for the Open Event Before Sending a Message<br />// Wait until the open event before calling send().<br />var ws = new WebSocket("ws://echo.websocket.org")<br />ws.onopen = function(e) {<br />ws.send("Initial data");<br />}</p> <p>Listing 2-13. Checking the readyState Property for an Open WebSocket<br />// Handle outgoing data. Send on a WebSocket if that socket is open.<br />function myEventHandler(data) {<br />if (ws.readyState === WebSocket.OPEN) {<br />// The socket is open, so it is ok to send the data.<br />ws.send(data);<br />} else {<br />// Do something else in this case.<br />//Possibly ignore the data or enqueue it.<br />}<br />}</p> <p><br />// Send a Blob<br />var blob = new Blob("blob contents");<br />ws.send(blob);<br />// Send an ArrayBuffer<br />var a = new Uint8Array([8,6,7,5,3,0,9]);<br />ws.send(a.buffer);</p> <p><br />Listing 2-15. Calling the close() Method<br />// Close the WebSocket connection<br />ws.close();<br />You can optionally pass two arguments to the close() method: code (a numerical<br />status code) and reason (a text string). Passing these arguments transmits information<br />to the server about why the client closed the connection. We will discuss the status<br />codes and reasons in greater detail in Chapter 3, when we cover the WebSocket closing<br />handshake. Listing 2-16 shows an example of calling the close() method with an<br />argument.<br />Listing 2-16. Calling the close() Method with a Reason<br />// Close the WebSocket connection because the session has ended successfully<br />ws.close(1000, "Closing normally");<br />Listing 2-16 uses code 1000, which means, as it states in the code, that the<br />connection is closing normally.</p> <p><br />WebSocket Object Attributes<br />There are several WebSocket Object attributes you can use to provide more information<br />about the WebSocket object: readyState, bufferedAmount, and protocol.</p> <p>Table 2-1. readyState Attributes, Values, and Status Descriptions<br />Attribute Constant     Value     Status<br />WebSocket.CONNECTING   0   The connection is in progress but has not been established.<br />WebSocket.OPEN   1   The connection has been established. Messages can flow between the client and server.<br />WebSocket.CLOSING   2   The connection is going through the closing handshake.<br />WebSocket.CLOSED   3   The connection has been closed or could not be opened.</p> <p>WebSocket Object Attribute: protocol<br />The protocol attribute is the empty string before the<br />opening handshake completes and remains an empty string if the server does not choose<br />one of the protocols offered by the client.</p> <p> </p><img src ="http://www.shnenglu.com/Error/aggbug/212860.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Error/" target="_blank">Enic</a> 2016-02-22 17:02 <a href="http://www.shnenglu.com/Error/archive/2016/02/22/212860.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.21gou.cn" target="_blank">国产精品久久久久久福利69堂</a>| <a href="http://www.woool-woool.com.cn" target="_blank">国产一区二区精品久久</a>| <a href="http://www.hifistudio.cn" target="_blank">日韩十八禁一区二区久久</a>| <a href="http://www.xici.cq.cn" target="_blank">亚洲欧美日韩精品久久亚洲区 </a>| <a href="http://www.dtvpartner.com.cn" target="_blank">国产精品99久久精品爆乳</a>| <a href="http://www.haihuasuye.cn" target="_blank">国产99久久久国产精免费</a>| <a href="http://www.x3077.cn" target="_blank">亚洲综合日韩久久成人AV</a>| <a href="http://www.windows7pe.cn" target="_blank">色综合久久中文综合网</a>| <a href="http://www.9r6.com.cn" target="_blank">国产精品99久久久精品无码</a>| <a href="http://www.syiz.cn" target="_blank">91久久成人免费</a>| <a href="http://www.jxjiahegs.cn" target="_blank">亚洲午夜久久久影院</a>| <a href="http://www.ldzv.cn" target="_blank">久久e热在这里只有国产中文精品99 </a>| <a href="http://www.csafebox.cn" target="_blank">91精品国产91久久综合</a>| <a href="http://www.mtdo.cn" target="_blank">亚洲午夜久久久</a>| <a href="http://www.hxsnw.com.cn" target="_blank">segui久久国产精品</a>| <a href="http://www.yaojikeji.cn" target="_blank">无码人妻久久一区二区三区免费</a>| <a href="http://www.yushiji505.cn" target="_blank">亚洲乱亚洲乱淫久久</a>| <a href="http://www.zjyffm.cn" target="_blank">漂亮人妻被黑人久久精品</a>| <a href="http://www.shawcai.cn" target="_blank">日韩va亚洲va欧美va久久</a>| <a href="http://www.01pz.cn" target="_blank">成人精品一区二区久久久</a>| <a href="http://www.hanlexin.cn" target="_blank">日产精品久久久久久久性色</a>| <a href="http://www.zjjhart.cn" target="_blank">香蕉久久久久久狠狠色</a>| <a href="http://www.tmsystem888.cn" target="_blank">国产成人精品久久亚洲</a>| <a href="http://www.matchweb.cn" target="_blank">99精品国产在热久久</a>| <a href="http://www.rideos.cn" target="_blank">天堂久久天堂AV色综合</a>| <a href="http://www.78918.com.cn" target="_blank">大香伊人久久精品一区二区</a>| <a href="http://www.ogpx95.cn" target="_blank">国产精品嫩草影院久久</a>| <a href="http://www.520king.cn" target="_blank">国产一区二区三区久久</a>| <a href="http://www.shecb2b.com.cn" target="_blank">97精品久久天干天天天按摩</a>| <a href="http://www.syiz.cn" target="_blank">亚洲国产精品成人久久</a>| <a href="http://www.dhxxw.cn" target="_blank">日本强好片久久久久久AAA</a>| <a href="http://www.jingxi.jx.cn" target="_blank">久久99精品国产麻豆宅宅</a>| <a href="http://www.fandele.cn" target="_blank">合区精品久久久中文字幕一区</a>| <a href="http://www.lcvy.cn" target="_blank">久久精品国产精品亚洲下载 </a>| <a href="http://www.tduck.cn" target="_blank">久久―日本道色综合久久</a>| <a href="http://www.tzfxw.cn" target="_blank">久久久精品2019免费观看</a>| <a href="http://www.51d1.cn" target="_blank">久久精品国产99久久久</a>| <a href="http://www.esog.com.cn" target="_blank">97久久超碰国产精品旧版</a>| <a href="http://www.xt87.cn" target="_blank">激情伊人五月天久久综合</a>| <a href="http://www.hp6000.cn" target="_blank">国产精品久久久久影院色</a>| <a href="http://www.mdwmp.com.cn" target="_blank">国产精品久久久久aaaa</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>