0

PHP ソケットと iPhone を使用してビデオ チャット アプリを作成しています。

以下のチュートリアルを使用して、ソケットで画像を送信しています http://www.binarytides.com/php-socket-programming-tutorial/

ソケットを介して画像を送信しています。

以下のコードを変更して、複数のクライアントに画像を送信しました

// Handle Input
            for($i = 0; $i < $this->max_clients; $i++) // for each client
            {
                if(isset($this->clients[$i]))
                {
                    if(in_array($this->clients[$i]->socket, $read))
                    {
                        $input = socket_read($this->clients[$i]->socket, $this->max_read);
                        if($input == null)
                        {
                            $this->disconnect($i);
                        }
                        else
                        {  
                            for($mx=0; $mx < count($this->clients); $mx++ ){
                                if($mx != $i ){
                                    $this->trigger_hooks("INPUT",$this->clients[$mx],$input);
                                }
                            }

                        }
                    }
                }
            }
            return true;
        }

画像を (Iphone クライアント経由で) ループで送信すると、送受信に時間がかかり (1 ~ 2 秒の遅延)、5 ~ 10 分後に画像の送信に失敗します。

ビデオの画像をすばやく送信するにはどうすればよいですか?

返信してください ...

4

0 に答える 0