Browse Source

fix handler function response

main 1.1.0
yggverse 7 months ago
parent
commit
52b43a252d
  1. 5
      README.md
  2. 8
      src/Server.php

5
README.md

@ -73,12 +73,15 @@ $server->start( @@ -73,12 +73,15 @@ $server->start(
function (
string $request,
string $connect
) {
): ?string
{
printf(
'connection: %s request: %s',
$connect,
$request
);
return null; // null|string response
}
);
```

8
src/Server.php

@ -145,6 +145,14 @@ class Server @@ -145,6 +145,14 @@ class Server
$request,
$connect
);
if ($response)
{
fwrite(
$incoming,
$response
);
}
}
fclose(

Loading…
Cancel
Save