本文整理匯總了PHP中response::me方法的典型用法代碼示例。如果您正苦於以下問題:PHP response::me方法的具體用法?PHP response::me怎麽用?PHP response::me使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類response
的用法示例。
在下文中一共展示了response::me方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: serveUserList
private function serveUserList()
{
$data = array('event' => 'userlist', 'data' => $this->clients);
response::all(json_encode($data), true);
$data['client'] = response::$current_socket_key;
response::me(json_encode($data));
}
示例2: event_message
protected function event_message($data, $client)
{
response::me('hello world, i am the default module!');
}
示例3: array
if (DEBUG) {
echo "[DEBUG] client {$sock} disconnecting...\n";
}
module::dispatch_event('close', false, $sock, array());
// close socket
socket_close($s);
unset($sockets[$sock]);
unset($clients[$sock]);
//array_splice($sockets, $sock, 1);
//array_splice($clients, $sock, 1);
} else {
if (!$clients[$sock] && web_socket_protocol::is_handshake($str)) {
if (DEBUG) {
echo "web socket request!\n";
}
response::me(web_socket_protocol::handshake($str));
$clients[$sock] = 'websocket';
//flag the client as a web socket client
} else {
///TODO create client_data and
module::dispatch_event('message', $str, $sock, array());
}
}
}
}
}
}
} while (true);
socket_close($listen);
if ($listen_policy) {
socket_close($listen_policy);