<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 4.2.13 [TOC] ## 修復(需注意的不兼容變更) * 修復Redis訂閱模式API設計問題導致重復訂閱和訂閱消息丟失的問題 (詳見:[訂閱模式文檔](https://wiki.swoole.com/wiki/page/1041.html)或 附錄示例代碼) ([#2305](https://github.com/swoole/swoole-src/pull/2305)) (@windrunner414) * 使用協程化時, 不能再`pconnect`等傳統連接復用的方法, 否則會產生多協程同時復用同一個Socket的問題 ([7b1e786](https://github.com/swoole/swoole-src/commit/7b1e78643c40b0c8ace1bca8c7b10e3064cce488)) (@shiguangqi) ## 增強 * 協程客戶端支持全雙工 ([#2350](https://github.com/swoole/swoole-src/pull/2350)) (@twosee) * 支持安全的跨協程close ([#2327](https://github.com/swoole/swoole-src/pull/2327)) (@twosee) * [RFC-1015](https://github.com/swoole/rfc-chinese/issues/38): 非Worker進程允許單向投遞任務 ([222043a](https://github.com/swoole/swoole-src/commit/222043a235b7a4eb62b7d14f1ab38844c7bdd510)) (@matyhtf) * `swoole_strerror`支持自動轉換系統錯誤碼和Swoole底層錯誤碼為文字, 無需指定參數 ([c92f444](https://github.com/swoole/swoole-src/commit/c92f44460b1762a3165ac3d8e2733b5a6db19092)) (@twosee) * gdb追蹤工具支持查看定時器和reactor信息 ([2beb563](https://github.com/swoole/swoole-src/commit/2beb563abe3f2dec8b7a9f0327fb63f0bc946e14)) (@shiguangqi) * 使用Redis集群時出現MOVED和ASK錯誤時將自動轉移到對應服務端 ([#2299](https://github.com/swoole/swoole-src/pull/2299)) (@windrunner414) * 底層代碼優化, 減少收包時的內存拷貝 (@matyhtf) * 現在調用`Co\Socket->close()`將會立即close fd, 而非等待對象析構后close, close后調用其它任何API將返回BADF錯誤 (和系統API保持一致) ([7a61963](https://github.com/swoole/swoole-src/commit/7a6196359686d749b7e045908414f82b105dbbdc)) (@twosee) * 一些非法的參數不再會導致致命錯誤而是產生一個警告, 因為外部傳參有時不可控, 存在一定風險 ([cd432d3](https://github.com/swoole/swoole-src/commit/cd432d31c3e358fcdb297390967a3187b35433f9)) (@twosee) * 使用協程化后API兼容性增強(和同步阻塞表現一致) ([36687e8](https://github.com/swoole/swoole-src/commit/36687e8081a36060f56ceca4272fb6358c092529)) (@matyhtf) * 現在swoole\\src可以同時作為C\\C++庫使用(libswoole) ## 修復 * 修復初次加載前存在大量對象時可能的coredump問題 ([4ddeedb](https://github.com/swoole/swoole-src/commit/4ddeedbb06351b03dc94c495eaae60b8a007e65e)) (@twosee) * 修復沒有DNS緩存時嘗試清除緩存導致的coredump ([#2288](https://github.com/swoole/swoole-src/pull/2288)) (@mabu233) * 啟用`task_enable_coroutine`后, 錯誤地調用`Server->finish`會觸發致命錯誤 ([156ede6](https://github.com/swoole/swoole-src/commit/156ede623b7fff6ec1aa9c290bd5cae8fca1d51a)) (@twosee) * 現在php.ini配置指定`On`和`Off`時能正確顯示(而不是顯示0) ([fe25982](https://github.com/swoole/swoole-src/commit/fe259822fc316adbb576a116f75137cc934d6b13)) (@twosee) * 修復`Co::getaddrinfo`后幾個參數接收錯誤的BUG ([#2273](https://github.com/swoole/swoole-src/pull/2273)) (@mabu233) * 修復dispatch\_func在UDP模式下時fd錯誤的問題 ([#2306](https://github.com/swoole/swoole-src/pull/2306)) (@mabu233) * 修復dispatch\_func在指定函數名時不生效的BUG, 回調在未接收包體數據參數時減少內存拷貝(如基于fd分配的模式) ([2bc49e4](https://github.com/swoole/swoole-src/commit/2bc49e4dc16d408f7cc5043c09d7435802abbdcf)) (@twosee) * Task過期時將不再觸發PHP警告(而是swoole底層的日志警告) ([54eee5e](https://github.com/swoole/swoole-src/commit/54eee5e128daf85d72b1cb2d59e0d9c08827653b)) (@matyhtf) * 修復進程重啟時enable\_coroutine失效問題 ([#2310](https://github.com/swoole/swoole-src/pull/2310)) * 修復進程id屬性不正確的問題 ([#2313](https://github.com/swoole/swoole-src/pull/2313)) (@junwei-qu) * 修復BASE模式下錯誤地在onStart回調中使用異步API導致的問題 ([#2308](https://github.com/swoole/swoole-src/issues/2308)) (@matyhtf) * 修復BASE模式下manager\_id不正確 ([e18e013](https://github.com/swoole/swoole-src/commit/e18e013cac20d3d4e332360ddcc7ba5ffb035346)) (@matyhtf ) * 修復mmap使用SEEK\_END偏移錯誤 ([#2314](https://github.com/swoole/swoole-src/pull/2314)) (@junwei-qu) * 修復getSocket內存泄漏 ([ec8c4b2](https://github.com/swoole/swoole-src/commit/ec8c4b2be95aa27d0984bd85460c40da7a088e34)) (@twosee) * 優化stream模式 ([47e0e9e](https://github.com/swoole/swoole-src/commit/47e0e9ec7e56c7c664a1d04acb0f8fbe40710e98)) (@matyhtf ) * 修復同步客戶端KEEP模式下連接復用在某些情況下導致的BUG ([4c5728b](https://github.com/swoole/swoole-src/commit/4c5728b5b552de09d9bf6bd323fb62473071a4a5)) (@matyhtf) * 修復MacOS下`Atmoic`多次`wait`和`wakeup`溢出的問題 ([fbccb25](https://github.com/swoole/swoole-src/commit/fbccb252707812f1791280bcaaa2048b7e8f601a)) (@twosee) * 修復開啟static\_handler存在目錄遍歷攻擊風險的問題, 這是一個便利性調試功能, 請勿用于生產 ([#2323](https://github.com/swoole/swoole-src/pull/2323)) (@windrunner414) * 修復未檢查futex\_wait系統調用的返回值 ([#2351](https://github.com/swoole/swoole-src/pull/2351)) (@junwei-qu) * 修復Reids::ZAdd API解析參數的BUG, 并修復其它潛在的類型轉換問題 ([#2321](https://github.com/swoole/swoole-src/issues/2321)) ([21e0497](https://github.com/swoole/swoole-src/commit/21e04977659ca48e69f65bda097683eaef98f36e)) ([a0e612f](https://github.com/swoole/swoole-src/commit/a0e612f4308fb8702d84a38d8d8a4921b096a733)) ([00134cf](https://github.com/swoole/swoole-src/commit/00134cfa7d730c10edc623abae4866cfec2acc23)) ([f5a331e](https://github.com/swoole/swoole-src/commit/f5a331e011f378ef36ab3f7e47af12b35e53e374)) ([5f87f17](https://github.com/swoole/swoole-src/commit/5f87f178ccc1f9dbab65745618cd22351e896574)) ([a15f094](https://github.com/swoole/swoole-src/commit/a15f094e42eba6df67e0b7678648c261f6e05c7c)) ([67f3285](https://github.com/swoole/swoole-src/commit/67f328541e5a0cb17e532038c7a35b4666e42b1b)) ([808f578](https://github.com/swoole/swoole-src/commit/808f57826160578223e5e90ba4d370930410b6a9)) ([d118fe3](https://github.com/swoole/swoole-src/commit/d118fe3f9e5b3b15877bb49eacccc38bd4b992d8)) ([5294473](https://github.com/swoole/swoole-src/commit/52944739f61e36cb49a2828ec699da3bfb5d7c63)) ([48f6790](https://github.com/swoole/swoole-src/commit/48f6790deeaa5b2e6fae90ada1ca6d87a99c410e)) ([0105c7f](https://github.com/swoole/swoole-src/commit/0105c7f6c24551434e4e7542c4b6fb1b3ca31959)) ([ba6c8b4](https://github.com/swoole/swoole-src/commit/ba6c8b4c25c27a62a3ad8dc035d19d6012ee0e64)) (@matyhtf) * 修復發送數據時沒有使用函數指針可能導致的第三方hook失敗 ([89ba2da](https://github.com/swoole/swoole-src/commit/89ba2dafe75b83ca8e459345c719f8e83aa53480)) (@matyhtf ) * 兼容性: Mysql escape方法出錯時將返回空字符串而不是FALSE * 修復Timer::tick方法有傳參時產生的內存泄露 ([7e15141](https://github.com/swoole/swoole-src/commit/7e15141177b84c9a18030f1f8b7fcdcd9a29a83c)) (@mabu233) * 修復自定義進程不能自動退出 ([2901ce0](https://github.com/swoole/swoole-src/commit/2901ce0a975486e1b656906858a0b7d2f1c52603)) (@matyhtf) * 修復協程化后連接超時時間影響到讀操作超時時間 ([a990540](https://github.com/swoole/swoole-src/commit/a9905408989dcee4b31a3d5b6ca68c9ecde855e6)) (@shiguangqi) * 修復`Co\Client`指定收包規則后, 傳參超時時間不生效的問題 ([#2346](https://github.com/swoole/swoole-src/issues/2346)) (@twosee) * Server在BASE模式下不再受`buffer_output_size`限制, 僅受`socket_buffer_size`限制 ([#2326](https://github.com/swoole/swoole-src/issues/2326)) (@matyhtf) * 修復在FREEBSD下的編譯錯誤 ([#2325](https://github.com/swoole/swoole-src/issues/2325)) (@matyhtf) ## 單元測試 * 更多的單元測試 * 新增內存測試到valgrind分支, 分離alpine測試到alpine分支, 自動觸發測試 * 測試支持在任意裝有docker的主機上運行并自動部署基于docker的swoole/mysql/redis容器, 詳情參閱源碼目錄下travis文件夾內的README文檔 ## 其它 * Swoole\\Serialize現已支持在PHP73下正常運作, 但仍標記為待廢除的功能, 不建議使用 ## 附錄 ### 協程Redis訂閱模式示例代碼: ~~~ $redis = new Swoole\Coroutine\Redis(); $redis->connect('127.0.0.1', 6379); if ($redis->subscribe(['channel1', 'channel2', 'channel3'])) // 或者使用psubscribe { while ($msg = $redis->recv()) { // msg是一個數組, 包含以下信息 // $type # 返回值的類型:顯示訂閱成功 // $name # 訂閱的頻道名字 或 來源頻道名字 // $info # 目前已訂閱的頻道數量 或 信息內容 list($type, $name, $info) = $msg; if ($type == 'subscribe') // 或psubscribe { // 頻道訂閱成功消息,訂閱幾個頻道就有幾條 } else if ($type == 'unsubscribe' && $info == 0) // 或punsubscribe { break; // 收到取消訂閱消息,并且剩余訂閱的頻道數為0,不再接收,結束循環 } else if ($type == 'message') // 若為psubscribe,此處為pmessage { // 打印來源頻道名字 var_dump($name); // 打印消息 var_dump($info); // 處理消息 if ($need_unsubscribe) // 某個情況下需要退訂 { $redis->unsubscribe(); // 繼續recv等待退訂完成 } } } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看