- dumb async http server
- dumb forking http server
- dumb forking https server
- dumb http server
- dumb jsonrpc server
- dumb smtp server
- dumb soap server
- dumb syslog server
- dumb xmlrpc server
- fork with shared
- get http head
- ipc queues
- nshttpd
- persistent forking xmlrpc server
- shared obj
- simple chat server
- time server
- timer test
Click on the filename to view the highlighted source code.
dumb_async_http_server.php
<?php
require "nanoserv/handlers/HTTP/Server.php";
use \Nanoserv\Core as Nanoserv;
class dumb_async_httpd extends \Nanoserv\HTTP\Async_Server {
private $response;
public function Send_Deferred_Response() {
$this->Send_Response($this->response);
}
public function on_Request($url) {
$this->response = "You asked for url : <b>{$url}</b>\n";
\Nanoserv\Core::New_Timer(3, array($this, "Send_Deferred_Response"));
}
}
Nanoserv::New_Listener("tcp://0.0.0.0:800", "dumb_async_httpd")->Activate();
Nanoserv::Run();
?>