久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <legend id='RhpeQ'><style id='RhpeQ'><dir id='RhpeQ'><q id='RhpeQ'></q></dir></style></legend>

    • <bdo id='RhpeQ'></bdo><ul id='RhpeQ'></ul>
    <i id='RhpeQ'><tr id='RhpeQ'><dt id='RhpeQ'><q id='RhpeQ'><span id='RhpeQ'><b id='RhpeQ'><form id='RhpeQ'><ins id='RhpeQ'></ins><ul id='RhpeQ'></ul><sub id='RhpeQ'></sub></form><legend id='RhpeQ'></legend><bdo id='RhpeQ'><pre id='RhpeQ'><center id='RhpeQ'></center></pre></bdo></b><th id='RhpeQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RhpeQ'><tfoot id='RhpeQ'></tfoot><dl id='RhpeQ'><fieldset id='RhpeQ'></fieldset></dl></div>
    1. <tfoot id='RhpeQ'></tfoot>

    2. <small id='RhpeQ'></small><noframes id='RhpeQ'>

      用于實(shí)時(shí)聊天應(yīng)用程序的 HTML5 Websockets?

      HTML5 Websockets for Realtime Chat app?(用于實(shí)時(shí)聊天應(yīng)用程序的 HTML5 Websockets?)

      <legend id='hBNZ0'><style id='hBNZ0'><dir id='hBNZ0'><q id='hBNZ0'></q></dir></style></legend>

      <small id='hBNZ0'></small><noframes id='hBNZ0'>

          • <bdo id='hBNZ0'></bdo><ul id='hBNZ0'></ul>
            <tfoot id='hBNZ0'></tfoot>
            1. <i id='hBNZ0'><tr id='hBNZ0'><dt id='hBNZ0'><q id='hBNZ0'><span id='hBNZ0'><b id='hBNZ0'><form id='hBNZ0'><ins id='hBNZ0'></ins><ul id='hBNZ0'></ul><sub id='hBNZ0'></sub></form><legend id='hBNZ0'></legend><bdo id='hBNZ0'><pre id='hBNZ0'><center id='hBNZ0'></center></pre></bdo></b><th id='hBNZ0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hBNZ0'><tfoot id='hBNZ0'></tfoot><dl id='hBNZ0'><fieldset id='hBNZ0'></fieldset></dl></div>

                  <tbody id='hBNZ0'></tbody>
              1. 本文介紹了用于實(shí)時(shí)聊天應(yīng)用程序的 HTML5 Websockets?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                我們計(jì)劃使用 Websockets 技術(shù)制作一個(gè)基于 HTML5 的聊天應(yīng)用程序.

                We were planning to make an HTML5 based chat app using the Websockets technology.

                所以我的問(wèn)題是:

                1. 截至今天,哪些瀏覽器本身支持 Websockets?

                如果瀏覽器不支持它,什么是可能的優(yōu)雅回退?

                有沒(méi)有可以提供幫助的 polyfill?

                問(wèn)候,

                推薦答案

                目前有哪些瀏覽器原生支持 Websocket?

                Which are the browsers that support Websockets natively currently as of today?

                正如之前的答案所指出的那樣.

                As pointed out in previous answers.

                見(jiàn):

                • http://caniuse.com/websockets
                • http://html5please.com/#Websockets

                如果瀏覽器不支持它,什么是可能的優(yōu)雅回退?

                If a browser does not support it, what is a possible graceful fallback?

                如果您的實(shí)時(shí)網(wǎng)絡(luò)服務(wù)器僅支持 WebSockets,那么下一個(gè)最佳選擇是使用 web-socket-js 它是一個(gè)基于 Flash 的 polyfill,它創(chuàng)建了一個(gè) WebSocket 對(duì)象,該對(duì)象以與原生 WebSocket 對(duì)象相同的方式進(jìn)行交互.

                If your realtime web server only supports WebSockets then the next best option is to use web-socket-js it's a Flash-based polyfill which creates a WebSocket object which an be interacted with in the same ways as the native WebSocket object.

                其他回退 - 需要由您的實(shí)時(shí)網(wǎng)絡(luò)服務(wù)器支持并由它提供的 JavaScript 客戶端庫(kù)管理 - 是從最好到最壞的順序:

                Additional fallbacks - which need to be supported by your realtime web server and managed by the JavaScript client library it provides - are, ordered best to worst:

                1. EventSource - 來(lái)自服務(wù)器 -> 客戶端的單個(gè)流連接.可以使用第二個(gè) HTTP 請(qǐng)求實(shí)現(xiàn)雙向通信.
                2. HTTP 流 - 使用兩個(gè)連接來(lái)模擬雙向連接.消息通過(guò)持久的流"連接服務(wù)器推送" -> 客戶端
                3. HTTP 長(zhǎng)輪詢 - 也使用兩個(gè)連接.但是,服務(wù)器 -> 客戶端已打開(kāi),一直保持到新消息可用或發(fā)生超時(shí).然后關(guān)閉它,如果設(shè)置了任何數(shù)據(jù),它會(huì)在響應(yīng)中傳遞.
                4. 標(biāo)準(zhǔn) HTTP 輪詢 - 效率低得多,而且可能會(huì)浪費(fèi)大量請(qǐng)求.但是,如果您的應(yīng)用程序提供的更新沒(méi)有那么頻繁地發(fā)生,并且數(shù)據(jù)在輪詢請(qǐng)求之間的時(shí)間是否過(guò)時(shí)"也無(wú)關(guān)緊要,那么這可能是一個(gè)可以接受的解決方案.這里沒(méi)有推".
                1. EventSource - A single streaming connection from server -> client. Bi-directional communication can be achieved using a second HTTP request.
                2. HTTP Streaming - uses two connections to simulate bi-directional connectivity. Messages are 'pushed' over a persistent 'streaming' connection server -> client
                3. HTTP Long-Polling - also uses two connections. However, the server -> client is opened, held until either a new message is available or a timeout occurs. It's then closed and if any data has been set it is delivered in the response.
                4. Standard HTTP polling - much less efficient and due to the large amount of potentially wasted requests. However, if the updates your app delivers don't happen all that frequently and it doesn't matter if data is 'out of date' for the time between polling requests, then this may be an acceptable solution. There is no 'push' here.

                選項(xiàng) 1. 和 2. 可以通過(guò)多種不同的方式實(shí)現(xiàn),具體取決于網(wǎng)絡(luò)瀏覽器.這就是使他們成為黑客"的原因.我們現(xiàn)在有用于雙向通信的 WebSocket 和 EventSource(服務(wù)器發(fā)送的事件),它與 HTTP Streaming 非常相似,并且具有支持自動(dòng)重新連接的額外好處.

                Options 1. and 2. can be achieved in numerous different ways depending on the web browser. This is what makes them 'hacks'. We now have WebSocket for bi-directional communication and EventSource (server-sent events) which is very similar to HTTP Streaming with the added benefit of it supporting auto-reconnection.

                是否有 polyfill 可以提供幫助?

                Is there a polyfill that can help?

                是的,請(qǐng)參閱前面提到的 web-socket-js.

                Yes, see web-socket-js as previously mentioned.

                對(duì)于 PHP,您的最佳選擇是 Ratchet.它不在 Apache 中運(yùn)行,因此不會(huì)受到相同的限制 - 它沒(méi)有考慮到請(qǐng)求/響應(yīng)范式.

                For PHP your best choice is Ratchet. It doesn't run within Apache so it doesn't suffer from the same limitations - it wasn't built with the Request/Response paradigm in mind.

                我現(xiàn)在看到的最常用的解決方案是:

                The most commonly used solutions I see right now are:

                • Faye - node.js 和 ruby??
                • socket.io - node.js 和適用于各種其他語(yǔ)言的端口
                • SockJS - erlang、node.js、ruby
                • SignalR - .NET
                • XSockets - .NET
                • Faye - node.js and ruby
                • socket.io - node.js and ports available for various other languages
                • SockJS - erlang, node.js, ruby
                • SignalR - .NET
                • XSockets - .NET

                對(duì)于其他選項(xiàng) - 包括托管服務(wù),如 Pusher(我在撰寫(xiě)本文時(shí)為其工作) - 看看這個(gè) 實(shí)時(shí)網(wǎng)絡(luò)技術(shù)指南,我正在維護(hù)(并接受對(duì)其的貢獻(xiàn)).

                For other options - including hosted services like Pusher (who I work for at the time of writing) - take a look at this realtime web tech guide which I'm maintaining (and accepting contributions towards).

                這篇關(guān)于用于實(shí)時(shí)聊天應(yīng)用程序的 HTML5 Websockets?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
                <i id='Gjry4'><tr id='Gjry4'><dt id='Gjry4'><q id='Gjry4'><span id='Gjry4'><b id='Gjry4'><form id='Gjry4'><ins id='Gjry4'></ins><ul id='Gjry4'></ul><sub id='Gjry4'></sub></form><legend id='Gjry4'></legend><bdo id='Gjry4'><pre id='Gjry4'><center id='Gjry4'></center></pre></bdo></b><th id='Gjry4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Gjry4'><tfoot id='Gjry4'></tfoot><dl id='Gjry4'><fieldset id='Gjry4'></fieldset></dl></div>
              2. <small id='Gjry4'></small><noframes id='Gjry4'>

                  <tbody id='Gjry4'></tbody>
                <legend id='Gjry4'><style id='Gjry4'><dir id='Gjry4'><q id='Gjry4'></q></dir></style></legend>
                    <tfoot id='Gjry4'></tfoot>

                        <bdo id='Gjry4'></bdo><ul id='Gjry4'></ul>

                          主站蜘蛛池模板: 免费一看一级毛片 | 日韩av免费在线观看 | 日韩中文一区二区 | 看羞羞视频免费 | 亚洲国产成人久久综合一区,久久久国产99 | 91久久精品一区二区二区 | 亚洲va欧美va天堂v国产综合 | 日韩欧美国产一区二区三区 | 久久综合久久综合久久综合 | 日韩五月天 | 美女天天操 | 欧美视频中文字幕 | 4hu最新网址 | 亚洲一区二区中文字幕 | 91九色麻豆| 国产免费xxx | 欧美精品a∨在线观看不卡 国产精品久久国产精品 | 久久影音先锋 | 亚洲国产精品一区二区第一页 | 99久久婷婷国产综合精品电影 | 国产精品视屏 | 欧美日韩在线免费观看 | 久久久久亚洲精品 | 中文字幕日韩欧美 | 大乳boobs巨大吃奶挤奶 | 日韩成人在线免费观看 | 中文字幕 国产 | 成人av观看 | 国产99久久久国产精品下药 | 欧美日韩国产精品一区 | 亚洲欧美另类在线观看 | 成人性生交大片 | 精品成人免费一区二区在线播放 | 国产午夜久久久 | 欧美一区永久视频免费观看 | 黄色大片在线播放 | 欧洲免费视频 | 成人免费在线视频 | 国产一区二区三区 | 日韩欧美一级精品久久 | 免费黄色在线观看 |