I modify the server program as follow and it works ok. But how do I use thread to expedite the execution?

void main()
{
        const int port = 8080;

        auto server = new ServerSocket (new IPv4Address(port));
        Cout("server started");
        while (true )
        {
                // wait for requests
                auto request = server.accept;
                // write a response
                request.output.write ("server replies 'hello'");              
                request.close;
        }
}

Reply via email to