start_io.php文件只改2個地方: $sender_io = new SocketIO(6665);//原文件是 2120 $inner_http_worker = new Worker('http://0.0.0.0:6666');// 原文件是2121 index.html里也改對對應(yīng)端口: $('#send_to_all').attr('href', 'http://'+document.domain+...
剛剛接觸長鏈接,是通過layer知道workerman的。 現(xiàn)在我的要求很簡單: 只想在現(xiàn)有的某個網(wǎng)頁里,當(dāng)其它用戶向數(shù)據(jù)庫插入了新的內(nèi)容后,就向所有在線用戶推送消息,告知有新數(shù)據(jù)進(jìn)來了。 不想用ajax方法實(shí)現(xiàn),這樣太浪費(fèi)帶寬。(阿里云主機(jī),帶寬很小)。...