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(
function ( function (
string $request, string $request,
string $connect string $connect
) { ): ?string
{
printf( printf(
'connection: %s request: %s', 'connection: %s request: %s',
$connect, $connect,
$request $request
); );
return null; // null|string response
} }
); );
``` ```

8
src/Server.php

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

Loading…
Cancel
Save