Exemplo n.º 1
0
 function testSelect()
 {
     $pipe = IO::pipe();
     $selector = new Selector();
     $selector->register($pipe[1], 'r');
     $pipe[0]->puts("Hello World");
     list($r) = $selector->select(0);
     $this->assertEquals(1, count($r));
     $r[0]->gets();
     $selector->unregister($pipe[1]);
     $pipe[0]->puts("Hello World");
     list($r) = $selector->select(0);
     $this->assertEquals(0, count($r));
 }