<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                >[danger] 該組件為系統組件,在組件樹中只可命名為 ws,不可修改為其他名稱。 ## 連接 WebSocket 連接組件保存了當前連接的實例,通過該實例可發送消息給客戶端,獲取客戶端信息。 | 類 | 調用 | | --- | --- | | Mix\WebSocket\WebSocketConnection | app()->ws | ## 依賴注入配置 [>> 到 GitHub 查看默認配置 <<](https://github.com/mix-php/mix/blob/v2/applications/websocket/config/main_coroutine.php#L189) ## `push` 方法 ``` ~~~ // 發送文本消息 $frame = new \Mix\WebSocket\Frame\TextFrame([ 'data' => $message, ]); app()->ws->push($frame); // 發送二進制消息 $frame = new \Mix\WebSocket\Frame\BinaryFrame([ 'data' => $message, ]); app()->ws->push($frame); // 發送關閉幀 $frame = new \Mix\WebSocket\Frame\CloseFrame([ 'code' => 1000, 'reason' => '' 'data' => $message, ]); app()->ws->push($frame); ~~~ ``` ## `getClientInfo` 方法 獲取客戶端信息 ``` $clientInfo = app()->ws->getClientInfo(); ``` ## `disconnect` 方法 關閉連接 ``` app()->ws->disconnect($code, $reason); ```
                  <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>

                              哎呀哎呀视频在线观看