title: Can a WinHTTP server handle clients in seperate thread just like Winsock
body: <h3>Objective</h3>
  <p>I'm writing an HTTP server in C++17.</p>
  <p>For the sake of the discussion, I reduce the requirements to:</p>
  <ol>
  <li>Simple HTTP Echo Server.</li>
  <li>Expects multiple clients.</li>
  <li>Clients constantly send simple <code>GET</code> requests.</li>
  <li>Handle each client in a separate thread.</li>
  <li>Respond by <code>200 OK</code></li>
  </ol>
  <h3>Winsock</h3>
  <p>I read this example: <a href="https://docs.microsoft.com/en-us/windows/win32/winsock/complete-server-code" rel="nofollow noreferrer">Winsock Server Source Code</a>.</p>
  <p>I understand how to adjust this example to answer the requirements (similar to what was <a href="https://stackoverflow.com/q/37285774/1798187">suggested here</a>):</p>
  <ol>
  <li>Create a <code>std::thread</code> that listen for clients</li>
  <li>When a client is accepted, create a new thread for the client and pass the new <code>SOCKET</code>.</li>
  </ol>
  <h3>WinHTTP</h3>
  <p>I also want to experiment with <code>WinHTTP</code> as well. So, I read this: <a href="https://docs.microsoft.com/en-us/windows/win32/http/http-server-sample-application" rel="nofollow noreferrer">HTTP Server Sample Application
  </a>.</p>
  <p>But, I got a bit lost trying to apply the same &quot;tactic&quot; as before. There is no equivalent WinHTTP function to Winsock's <a href="https://docs.microsoft.com/en-us/windows/win32/api/Winsock2/nf-winsock2-accept" rel="nofollow noreferrer"><code>accept()</code> function</a> that will allow me to create a thread per client.</p>
  <h3>Question</h3>
  <p>Assuming the approach I intend to apply in <code>Winsock</code> is valid, is there a similar approach to make <code>WinHTTP</code> handle each connection/client in a separate thread?</p>