We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b3eba6 commit 71addfcCopy full SHA for 71addfc
1 file changed
src/Server.php
@@ -30,14 +30,16 @@ public function listen($port, $host = '127.0.0.1')
30
}
31
stream_set_blocking($this->master, 0);
32
33
- $this->loop->addReadStream($this->master, function ($master) {
+ $that = $this;
34
+
35
+ $this->loop->addReadStream($this->master, function ($master) use ($that) {
36
$newSocket = stream_socket_accept($master);
37
if (false === $newSocket) {
- $this->emit('error', array(new \RuntimeException('Error accepting new connection')));
38
+ $that->emit('error', array(new \RuntimeException('Error accepting new connection')));
39
40
return;
41
- $this->handleConnection($newSocket);
42
+ $that->handleConnection($newSocket);
43
});
44
45
0 commit comments