If the client is performing a blocking operation, the method
returns a non-zero value. If the client is not performing a blocking
operation, or the client handle is invalid, the method returns
zero. To get extended error information, call GetLastError.
A blocking operation may allow the application to be re-entered. For
example, the user may press a button while another request is still in
progress. If this causes another blocking method to be called for the
same client session, the second operation will fail because only one
blocking operation can be active at a time.
The IsBlocking method can be used to determine if the client
is already blocked, and if so, take some other action, such as warning
the user that they must wait for the current operation to complete.
When a message is sent to the server using the SendMessage
or SendMessageEx methods, the client will block until the
message is sent and the server has responded, or until a timeout has
occurred. If you send a request to the server in your application's
main UI thread, you should present some visual indicator that the
application is waiting for the operation to complete. If you need to
ensure your application remains responsive while waiting for a response
from the server, you can send messages using a background worker
thread.