public function __construct($server, $port) { $this->server = gethostbyname($server); $this->port = intval($port); $this->delimeter = chr(0xc0) . chr(0x80); // setup our events Events::bind('ymsg.data.sent', function ($args = array()) { $this->onSentData($args); }); Events::bind('ymsg.data.recv', function ($args = array()) { $this->onRecvData($args); }); Events::bind('ymsg.cookie.got', function ($args = array()) { $this->gotCookie($args); }); Events::bind('ymsg.cookie.error', function ($args = array()) { $this->onError($args); }); Events::bind('ymsg.connected', function ($args = array()) { $this->onConnect($args); }); Events::bind('ymsg.message', function ($args = array()) { $this->onMessage($args); }); Events::bind('ymsg.disconnected', function ($args = array()) { $this->onDisconnect($args); }); }
function bind($page, $fn) { Events::bind($page, $fn); }
function bind($page, $fn, $area = 'main') { Events::bind($page, $fn, $area); }