views:

21

answers:

1

Hi,

What does a server connection with a blocking request mean?

Thank You!

+3  A: 

It means, when you make a request to the server, you wait until you hear back from it (blocking).

The advantage of this approach is that code that expects the request to complete will be ensured that the request has completed.

The downsides are that your code is "hung" until the request completes, and there is a chance that the request might not complete, which results in a hung thread.

Typically blocking requests are accompanied by timeouts, so after period of time, if no response is given, the call returns with an error indicated a timeout has elapsed, and you should diligently handle that case.

Web page requests are an example of a blocking request. When you type www.google.com into your browser, your browser makes a blocking request to Google's web server,waiting to display the response. If (for some crazy reason) google doesn't respond, you'll get a timeout error.

Alan
Thanks for the clear answer :)