WCF service crashed when asynchronus task throw exception
I have WCF service.
I have one function, my function connect to other service and Download data. Data is very big, because my function download data part by part. But for download part-by-part, my WCF service client timeout must be very big, and client must wait very long . I resolve this task but I have one problem.
Private Delegate Sub AsyncDelegate()
Private mObject As New Object
Private mFinished As Boolean = True
Public Function Finished() As Boolean
Public Sub AsynchronousDownload()
Dim asyncelegate As New AsyncDelegate(AddressOf Download)
mFinished = False
asyncelegate.BeginInvoke(AddressOf AsynchronousEndDownload, "")
Private Sub Download()
Private Sub AsynchronousEndDownload(ByVal ar As IAsyncResult)
Dim result As AsyncResult = CType(ar, AsyncResult)
Dim asyncelegate As AsyncDelegate = CType(result.AsyncDelegate, AsyncDelegate)
'Data contract part
Public Sub DownloadData() _
Public Function DownloadFinished() As Boolean _
'Service Call from client dll.
While Not Proxy.DownloadFinished()
I resolve the problem, and my client timeout is 1 minute. But when in Download() function throw exception my WCF service is crashed. My WCF service catch all exception and write in log file, but when throw exception in Asynchronous task(Download function), excheption can't catched.
Help me please...
Tags for this Thread