I am new to WCF, want to know what difference it make sync call or async call, it will be really helpful if some one will explain with example
Thanx
Async call from the client is same as any ohter async operation in .NET Framework. When you make sync call from a thread to the WCF service the thread will hang on. It means thread will not be able to do any other work until the service call returns response or exception. In contrast the async call will run in separate thread (created by framework) so your main thread will be able to continue in operation and it will be notified about completion of async call by callback (event).
So suppose that you have WinForms application as WCF client and you want to call WCF service. If you make a sync call which will take several seconds to complete your application will hangs on for this processing time = user will not be able to do anything with application (only kill it from task manager). But if you use async call it will be fully interactive because async operation will be handled by background thread. So async operations are suitable for interactive solutions or if you need to do multiple operations in parallel.
For example check this How to article from MSDN.
Just for completness I described difference between sync and async calls = synchronous and asynchronous processing on the client. WCF also supports sync and async operations = synchronnous and asynchronous processing on the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With