锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日本免费一区二区久久人人澡 ,人人狠狠综合久久88成人,久久国产精品免费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.naturepro.cn" target="_blank">久久福利片</a>| <a href="http://www.linglonggegame.cn" target="_blank">人人狠狠综合久久亚洲88</a>| <a href="http://www.drxt.com.cn" target="_blank">久久国产亚洲精品</a>| <a href="http://www.sjsgsl.net.cn" target="_blank">久久精品一本到99热免费</a>| <a href="http://www.loreng.cn" target="_blank">午夜精品久久久久久中宇</a>| <a href="http://www.itmr.com.cn" target="_blank">996久久国产精品线观看</a>| <a href="http://www.sonsan.cn" target="_blank">精品久久久久久久中文字幕</a>| <a href="http://www.chechuai.cn" target="_blank">久久久久久久久久久免费精品</a>| <a href="http://www.taiguolu.com.cn" target="_blank">久久综合九色综合久99</a>| <a href="http://www.238000.com.cn" target="_blank">日韩人妻无码精品久久久不卡 </a>| <a href="http://www.ivgh.cn" target="_blank">亚洲综合伊人久久大杳蕉</a>| <a href="http://www.vipvod.cn" target="_blank">久久久精品国产sm调教网站</a>| <a href="http://www.t0oal.cn" target="_blank">久久电影网</a>| <a href="http://www.gmlu.cn" target="_blank">久久青青草原国产精品免费 </a>| <a href="http://www.zurpd.cn" target="_blank">久久国产视频99电影</a>| <a href="http://www.benzclub.com.cn" target="_blank">国产69精品久久久久9999APGF</a>| <a href="http://www.bjwx2008.cn" target="_blank">a高清免费毛片久久</a>| <a href="http://www.jkzyzj.cn" target="_blank">久久人人爽人人人人片av</a>| <a href="http://www.love5000.cn" target="_blank">99久久国产综合精品网成人影院 </a>| <a href="http://www.tengzen.cn" target="_blank">久久人人爽人人人人片av</a>| <a href="http://www.a3314.cn" target="_blank">91久久精品无码一区二区毛片</a>| <a href="http://www.jsvvsj.cn" target="_blank">久久免费看黄a级毛片</a>| <a href="http://www.fanglan-tech.cn" target="_blank">国产精品美女久久久网AV</a>| <a href="http://www.unicity642.com.cn" target="_blank">久久精品国产亚洲av高清漫画</a>| <a href="http://www.smegdmm.cn" target="_blank">亚洲&#228;v永久无码精品天堂久久</a>| <a href="http://www.goldenshipping.cn" target="_blank">18岁日韩内射颜射午夜久久成人</a>| <a href="http://www.bao00long.cn" target="_blank">国产精自产拍久久久久久蜜</a>| <a href="http://www.wamiu.cn" target="_blank">狠狠色丁香婷婷久久综合不卡</a>| <a href="http://www.seekme.com.cn" target="_blank">久久精品免费一区二区</a>| <a href="http://www.huakuyaow.cn" target="_blank">波多野结衣久久精品</a>| <a href="http://www.suec.net.cn" target="_blank">久久午夜综合久久</a>| <a href="http://www.padshow.cn" target="_blank">久久久久国产精品麻豆AR影院</a>| <a href="http://www.dgabs.cn" target="_blank">91精品国产高清久久久久久91</a>| <a href="http://www.zl6688.com.cn" target="_blank">日产精品久久久久久久</a>| <a href="http://www.xiatiancaiwu.cn" target="_blank">99久久精品免费看国产一区二区三区</a>| <a href="http://www.ewokfijaa.cn" target="_blank">久久久黄片</a>| <a href="http://www.huiseng.cn" target="_blank">亚洲国产精品狼友中文久久久</a>| <a href="http://www.114best.com.cn" target="_blank">久久一区二区三区免费</a>| <a href="http://www.yueyuju.cn" target="_blank">色天使久久综合网天天</a>| <a href="http://www.p8595.cn" target="_blank">色老头网站久久网</a>| <a href="http://www.ipingpong.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>