How does a server handle web service requests from multiple clients

前端 未结 4 2093
野的像风
野的像风 2020-12-31 19:19

I just completed an Android application that uses web services to connect to a remote database. I was working on localhost.

Now, I plan to host my web services on a

4条回答
  •  星月不相逢
    2020-12-31 20:15

    The server will maintain a thread pool listening for incoming requests. Upon receiving a request, the thread will process the request and return the response. If all the requests are received at the same time and they're fewer than the maximum number of threads in the pool, they will all be services in parallel (though the actual processing will be interleaved based on the number of cores/cpus). If there are more requests than threads, the request will be queued (waiting for a connection) until either a thread frees up or the client request times out.

    If you're connecting to the service from a mobile network, there is higher latency in the initial connection but not enough to make a difference.

提交回复
热议问题