elephant.io
發表於 : 2013-10-16 16:18:41
https://github.com/Wisembly/elephant.io
http://www.ptt.cc/bbs/PHP/M.1365347407.A.64B.html
http://www.ptt.cc/bbs/PHP/M.1365347407.A.64B.html
代碼: 選擇全部
<?php
require( __DIR__ . '/../lib/ElephantIO/Client.php');
use ElephantIO\Client as ElephantIOClient;
$elephant = new ElephantIOClient('http://localhost:8124','socket.io', 1, false, true, true);
//連線
$elephant->init();$elephant->send(
ElephantIOClient::TYPE_EVENT, null, null,
json_encode(array('name' => 'addme', 'args' => 'jimpop'))); //傳送資料
$elephant->close(); //關閉連線
?>