delegate all the way down

This commit is contained in:
Adam D. Ruppe 2021-02-15 13:55:05 -05:00
parent 74640c3a21
commit 1af21c4b47
1 changed files with 11 additions and 2 deletions

13
cgi.d
View File

@ -4814,7 +4814,16 @@ class ListeningConnectionManager {
bool tcp; bool tcp;
void delegate() cleanup; 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) { 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; this.handler = handler;
listener = startListening(host, port, tcp, cleanup, 128); listener = startListening(host, port, tcp, cleanup, 128);
@ -4827,7 +4836,7 @@ class ListeningConnectionManager {
} }
Socket listener; Socket listener;
void function(Socket) handler; void delegate(Socket) handler;
bool running; bool running;
void quit() { void quit() {
@ -4911,7 +4920,7 @@ class ConnectionException : Exception {
} }
} }
alias void function(Socket) CMT; alias void delegate(Socket) CMT;
import core.thread; import core.thread;
/+ /+