Slide 21
Slide 21 text
Sample
event
controller
in
PHP
// Create an array of words
$sayings = array("the", "quick", "brown", "fox", "jumps", "over",
"lazy", "dogs");
// Open a controller channel to Meteor server
$op = fsockopen("127.0.0.1", 4671, $errno, $errstr, 5);
// Write a random word
$out = "ADDMESSAGE demo ".$sayings[array_rand($sayings)]."\n";
fwrite($op, $out);
// Read response
$buf = fread($op, 4096);