我不確定這個問題屬於這裏,因爲它是「有爭議的」,但讓我們試一試。 閱讀關於它大量實例和問題(如this one這似乎真的相似)之後,我仍然無法弄清楚,如果我要選擇多態性更換開關。 這是關於其接收JSON消息並根據該消息type執行的程序的棘輪的WebSocket服務器: public function onMessage(ConnectionInterface $from, $msg) {
你好我寫的PHP一個簡單的遊戲, 對這項工作我用http://socketo.me它有一個方法「的OnOpen()」,它是這樣的代碼 PHP: public function onOpen(ConnectionInterface $conn) {
// Store the new connection to send messages to later
$this->clien