From 1af21c4b47a9f137b0883223e58ec5c85a563311 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Mon, 15 Feb 2021 13:55:05 -0500 Subject: [PATCH] delegate all the way down --- cgi.d | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cgi.d b/cgi.d index 0f2135a..31d2899 100644 --- a/cgi.d +++ b/cgi.d @@ -4814,7 +4814,16 @@ class ListeningConnectionManager { bool tcp; void delegate() cleanup; + private void function(Socket) fhandler; + private void dg_handler(Socket s) { + fhandler(s); + } this(string host, ushort port, void function(Socket) handler) { + fhandler = handler; + this(host, port, &dg_handler); + } + + this(string host, ushort port, void delegate(Socket) handler) { this.handler = handler; listener = startListening(host, port, tcp, cleanup, 128); @@ -4827,7 +4836,7 @@ class ListeningConnectionManager { } Socket listener; - void function(Socket) handler; + void delegate(Socket) handler; bool running; void quit() { @@ -4911,7 +4920,7 @@ class ConnectionException : Exception { } } -alias void function(Socket) CMT; +alias void delegate(Socket) CMT; import core.thread; /+