Use $this in closure, fixed ref to handleData
This commit is contained in:
parent
8d8d574199
commit
b00da833ce
@ -98,15 +98,14 @@ class IoServer {
|
||||
|
||||
$this->app->onOpen($conn->decor);
|
||||
|
||||
$that = $this;
|
||||
$conn->on('data', function ($data) use ($conn) {
|
||||
$that->handleData($data, $conn);
|
||||
$this->handleData($data, $conn);
|
||||
});
|
||||
$conn->on('close', function () use ($conn, $that) {
|
||||
$that->handleEnd($conn);
|
||||
$conn->on('close', function () use ($conn) {
|
||||
$this->handleEnd($conn);
|
||||
});
|
||||
$conn->on('error', function (\Exception $e) use ($conn, $that) {
|
||||
$that->handleError($e, $conn);
|
||||
$conn->on('error', function (\Exception $e) use ($conn) {
|
||||
$this->handleError($e, $conn);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user