锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日本免费一区二区久久人人澡 ,人人狠狠综合久久88成人,久久国产精品免费http://m.shnenglu.com/Error/category/21182.htmlzh-cnMon, 22 Feb 2016 09:56:34 GMTMon, 22 Feb 2016 09:56:34 GMT60websocket 綆浠?/title><link>http://m.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://m.shnenglu.com/Error/archive/2016/02/22/212860.html</guid><wfw:comment>http://m.shnenglu.com/Error/comments/212860.html</wfw:comment><comments>http://m.shnenglu.com/Error/archive/2016/02/22/212860.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/Error/comments/commentRss/212860.html</wfw:commentRss><trackback:ping>http://m.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://m.shnenglu.com/Error/aggbug/212860.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/Error/" target="_blank">Enic</a> 2016-02-22 17:02 <a href="http://m.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://m.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.hotfan.cn" target="_blank">久久久精品波多野结衣</a>| <a href="http://www.8812345.com.cn" target="_blank">69SEX久久精品国产麻豆</a>| <a href="http://www.gg4493.cn" target="_blank">久久综合狠狠综合久久97色</a>| <a href="http://www.pgos.com.cn" target="_blank">精品国产综合区久久久久久</a>| <a href="http://www.20xjj.cn" target="_blank">伊人久久大香线蕉AV一区二区</a>| <a href="http://www.mdg163.cn" target="_blank">亚洲国产精品无码成人片久久</a>| <a href="http://www.ttyv.cn" target="_blank">国内精品伊人久久久久av一坑 </a>| <a href="http://www.car321.cn" target="_blank">欧美日韩精品久久久免费观看</a>| <a href="http://www.x6844.cn" target="_blank">精品无码久久久久国产动漫3d</a>| <a href="http://www.numxj.cn" target="_blank">青青草原1769久久免费播放</a>| <a href="http://www.xx0759.cn" target="_blank">日本久久中文字幕</a>| <a href="http://www.shqidao.cn" target="_blank">91精品国产乱码久久久久久</a>| <a href="http://www.99yingyuan.cn" target="_blank">久久国产欧美日韩精品免费</a>| <a href="http://www.c-c-city.com.cn" target="_blank">91视频国产91久久久</a>| <a href="http://www.baidu12.cn" target="_blank">久久久久久久久66精品片</a>| <a href="http://www.vvrj.cn" target="_blank">69久久夜色精品国产69</a>| <a href="http://www.wangjunyao.cn" target="_blank">久久久无码精品亚洲日韩京东传媒</a>| <a href="http://www.puhb.cn" target="_blank">国产精品9999久久久久</a>| <a href="http://www.feichangyemen.cn" target="_blank">久久人与动人物a级毛片</a>| <a href="http://www.gsasv.cn" target="_blank">久久精品国产WWW456C0M</a>| <a href="http://www.bclife.cn" target="_blank">久久99精品国产99久久6男男</a>| <a href="http://www.diylady.cn" target="_blank">久久精品无码一区二区WWW</a>| <a href="http://www.tmnv.cn" target="_blank">久久久久九九精品影院</a>| <a href="http://www.vdmo.cn" target="_blank">99热成人精品免费久久</a>| <a href="http://www.yzlxdr.cn" target="_blank">2021少妇久久久久久久久久</a>| <a href="http://www.07ww.cn" target="_blank">亚洲精品国产字幕久久不卡</a>| <a href="http://www.hwtk.net.cn" target="_blank">亚洲一级Av无码毛片久久精品</a>| <a href="http://www.dxcheck.cn" target="_blank">久久精品视频免费</a>| <a href="http://www.todd3015.cn" target="_blank">99久久99这里只有免费的精品</a>| <a href="http://www.ru87.cn" target="_blank">久久久久亚洲av综合波多野结衣</a>| <a href="http://www.093156.net.cn" target="_blank">久久精品成人免费国产片小草</a>| <a href="http://www.hjj9588.cn" target="_blank">91精品国产91久久久久福利</a>| <a href="http://www.aisile.com.cn" target="_blank">亚洲国产精品无码久久</a>| <a href="http://www.fgzpf.cn" target="_blank">亚洲国产成人久久精品动漫</a>| <a href="http://www.chqlt.cn" target="_blank">久久综合色区</a>| <a href="http://www.qwoj.cn" target="_blank">人人狠狠综合久久亚洲</a>| <a href="http://www.ntysjx.cn" target="_blank">久久一区二区三区99</a>| <a href="http://www.beijianyi.cn" target="_blank">亚洲欧美国产日韩综合久久</a>| <a href="http://www.mxylzc.cn" target="_blank">99久久精品国产高清一区二区</a>| <a href="http://www.qpvm.cn" target="_blank">综合久久精品色</a>| <a href="http://www.ahgmxy.com.cn" target="_blank">日产久久强奸免费的看</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>