锘??xml version="1.0" encoding="utf-8" standalone="yes"?>777久久精品一区二区三区无码,久久超乳爆乳中文字幕,91精品免费久久久久久久久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.525work.cn" target="_blank">99久久精品免费看国产一区二区三区 </a>| <a href="http://www.ntysjx.cn" target="_blank">中文精品久久久久国产网址</a>| <a href="http://www.rmbo.cn" target="_blank">无码AV中文字幕久久专区</a>| <a href="http://www.lmgv.cn" target="_blank">成人妇女免费播放久久久</a>| <a href="http://www.jumbo8.cn" target="_blank">久久99精品久久久久久野外</a>| <a href="http://www.songli.org.cn" target="_blank">精品久久久久久中文字幕</a>| <a href="http://www.xvjw.cn" target="_blank">一本一道久久a久久精品综合 </a>| <a href="http://www.uukibu.cn" target="_blank">久久人妻少妇嫩草AV蜜桃</a>| <a href="http://www.bamboomart.cn" target="_blank">国产精品久久久久久久久软件</a>| <a href="http://www.517banjia.cn" target="_blank">一本色道久久88综合日韩精品 </a>| <a href="http://www.epfy.cn" target="_blank">av无码久久久久久不卡网站</a>| <a href="http://www.facpw.cn" target="_blank">亚洲一区中文字幕久久</a>| <a href="http://www.joyq.com.cn" target="_blank">久久精品亚洲AV久久久无码</a>| <a href="http://www.lockdealing.cn" target="_blank">久久777国产线看观看精品</a>| <a href="http://www.ozwo.cn" target="_blank">久久久久久久综合狠狠综合</a>| <a href="http://www.swangxinwen.cn" target="_blank">精品久久久噜噜噜久久久</a>| <a href="http://www.oy14.cn" target="_blank">精品伊人久久久</a>| <a href="http://www.ylssmedia.cn" target="_blank">国产精品永久久久久久久久久</a>| <a href="http://www.panxl.cn" target="_blank">精品无码久久久久国产动漫3d</a>| <a href="http://www.fpsky.cn" target="_blank">国产午夜电影久久</a>| <a href="http://www.noahmachine.com.cn" target="_blank">欧美喷潮久久久XXXXx</a>| <a href="http://www.geekon.com.cn" target="_blank">亚洲精品无码久久久</a>| <a href="http://www.essledyntp.com.cn" target="_blank">中文字幕久久欲求不满</a>| <a href="http://www.oy14.cn" target="_blank">久久综合精品国产二区无码</a>| <a href="http://www.lbaak.cn" target="_blank">色天使久久综合网天天</a>| <a href="http://www.dgtoygift.cn" target="_blank">国产69精品久久久久9999</a>| <a href="http://www.ujjr.cn" target="_blank">久久精品国产清高在天天线</a>| <a href="http://www.npoq.cn" target="_blank">日日躁夜夜躁狠狠久久AV</a>| <a href="http://www.mmcase.cn" target="_blank">久久婷婷五月综合色奶水99啪</a>| <a href="http://www.fc-lawyer.cn" target="_blank">久久久久久久综合日本</a>| <a href="http://www.vyipin.cn" target="_blank">国产免费久久久久久无码</a>| <a href="http://www.uubux.com.cn" target="_blank">久久久久久久尹人综合网亚洲</a>| <a href="http://www.fbnnfzx.cn" target="_blank">成人久久综合网</a>| <a href="http://www.wqit.com.cn" target="_blank">四虎国产精品免费久久5151</a>| <a href="http://www.zmlxs.cn" target="_blank">狠狠久久亚洲欧美专区</a>| <a href="http://www.jkzyzj.cn" target="_blank">四虎国产精品免费久久5151</a>| <a href="http://www.9527dm.cn" target="_blank">久久这里只有精品久久</a>| <a href="http://www.itmr.com.cn" target="_blank">久久久久综合网久久</a>| <a href="http://www.mingqingrong.cn" target="_blank">精品久久久久久久中文字幕</a>| <a href="http://www.ttprinting.cn" target="_blank">久久久精品视频免费观看</a>| <a href="http://www.pewn.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>