mirror of
https://github.com/YGGverse/nps-php.git
synced 2025-01-15 17:30:08 +00:00
fix handler function response
This commit is contained in:
parent
64a7bc3e2a
commit
27a4dc5bca
@ -84,7 +84,8 @@ $server->start(
|
||||
string $content,
|
||||
string $request,
|
||||
string $connect
|
||||
) {
|
||||
): ?string
|
||||
{
|
||||
printf(
|
||||
'connection: %s request: %s',
|
||||
$connect,
|
||||
@ -97,6 +98,8 @@ $server->start(
|
||||
$content
|
||||
);
|
||||
}
|
||||
|
||||
return 'thank you!';
|
||||
}
|
||||
);
|
||||
```
|
||||
|
@ -185,10 +185,6 @@ class Server
|
||||
false
|
||||
);
|
||||
|
||||
fclose(
|
||||
$incoming
|
||||
);
|
||||
|
||||
if ($handler)
|
||||
{
|
||||
$response = call_user_func(
|
||||
@ -198,8 +194,20 @@ class Server
|
||||
$request,
|
||||
$connect
|
||||
);
|
||||
|
||||
if ($response)
|
||||
{
|
||||
fwrite(
|
||||
$incoming,
|
||||
$response
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(
|
||||
$incoming
|
||||
);
|
||||
|
||||
} while ($this->_live);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user