.NET Framework Bookmark and Share   
 index > .NET Framework Networking and Communication > WCF timeout, hosted in Windows Service
 

WCF timeout, hosted in Windows Service

Hi,
I am developing task manager.

The TaskManager acts as service at backend to execute task in async mode (multithreading - one task per thread). The task could be long running process that takes few mins to hours to complete.

In order to let client to request taskManager to execute any task, I use WCF (tcp) as communication proxy and hosted by Windows Service. Whenever requested received will be push to queue. A TaskManager timer will check for queue intervally and invoke the actual task.

From Web UI, I have a javascript timer to callback to WCF to get task status intervally and shown it in progress bar.

I faced problem that:-

1. Call to WCF will timeout after a few successful calls. However, the task is still running as status in db is updated as my task will update status back to db well from time to time.
2. When the task is running, task status callback is running intervally. If I click any link to navigate to other page, it will keep staying at the same screen till WCF timeout error occurred.

Beside, I have set my WCF service to have single instance, multiple concurrency mode.

Any ideas?

Please advice.

Thank you
chanmy8

Are you creating the instance of the wcf service globally. You should initialize the wcf service where you want and immediately close it when the work is completed.

For example

Private Function BindGrid()

    Dim client as  new MyWCFServiceClient
    dim myCollection as Collection = client.GetData()
    client.Close()

    ListBox1.DataSource = myCollection
    
    ''Your other code

End Function

Also following article could be helpful

http://www.codeproject.com/KB/WCF/WCF_Operation_Timeout_.aspx
Gaurav Khanna
  • Marked As Answer bychanmy8 Wednesday, September 16, 2009 9:59 AM
  •  
Khanna Gaurav

Are you creating the instance of the wcf service globally. You should initialize the wcf service where you want and immediately close it when the work is completed.

For example

Private Function BindGrid()

    Dim client as  new MyWCFServiceClient
    dim myCollection as Collection = client.GetData()
    client.Close()

    ListBox1.DataSource = myCollection
    
    ''Your other code

End Function

Also following article could be helpful

http://www.codeproject.com/KB/WCF/WCF_Operation_Timeout_.aspx
Gaurav Khanna
  • Marked As Answer bychanmy8 Wednesday, September 16, 2009 9:59 AM
  •  
Khanna Gaurav

You can use google to search for other answers

Custom Search

More Threads

• WinHttp.WinHttpRequest.5.1 com object
• Upload Video File
• Get server Name from 3DNS or WebFarm
• ErrorSystem.Web.HttpException: No se puede obtener acceso al objeto 'CDO.Message'. ---> System.Reflection.TargetInvocationExcept
• Create class that sends data
• Is useUnsafeHeaderParsing secure with https
• a general Socket.Send question..
• FTP and Web Drive
• Question on Cookie of HttpWebRequest and HttpWebResponse
• Sending emails using SmtpClient and IIS