Pass Socket to new thread

Kagamin spam at here.lot
Tue Aug 28 11:40:38 UTC 2018


while(true) {
     auto client = socket.accept();
     spawn(&handleConnection, cast(shared)client);
}

void handleConnection(shared Socket sclient) {
     Socket client=cast()sclient;
     //do stuff like receive and send
}


More information about the Digitalmars-d-learn mailing list