PHP "noblock" fgets?

1 Cevap php

Ben yeni bir sunucuya bağlanmak için yirmi GUI pop-up / windows tıklama yoluyla sahip tüm bu müşterilerin hasta alıyorum çünkü PHP küçük bir komut satırı IRC istemcisi oluşturmaya çalışıyorum.

Her şey bugüne kadar çalışıyor, ama ben sunucuya benim giriş komutları / mesajları gönderir ve ondan yeni verileri alır ana döngü ile şaşırıp.

PHP çok çoklu-görev-dostu değil gibi ben aynı anda çalışan iki özerk PHP komut var:

The input reader where I can enter my messages - it stores the current message in a text file. The server listener/writer which receives new data and reads and clears the text file where the input reader stored my current command in.

However fgets() which I use to read new data from the server pauses the script waiting until something new arrives. So the input text file can't be read out until something new arrives from the server, which is not good.

  • Bana yardımcı olmak için bazı özel fonksiyon / seçeneği var mı?