473,387 Members | 1,362 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

web service call locks up C# winforms application

I have a C# winforms application that makes periodic web service calls in
background thread to my web service server. These calls work fine almost all
the time but on rare occassions the web service method call will never return
and the entire application will freeze, even though the call is being made on
its own background thread, not the main UI thread.

Does anyone know any reason why a particular web service method call would
cause my entire C# application to lock up and become unresponsive? Again,
this call is initiated on a background thread and this thread does not
interact with the main UI thread at all.

Thanks for any ideas,

Colin
Oct 22 '07 #1
3 4644
"chendricks" <ch********@discussions.microsoft.comwrote in message
news:58**********************************@microsof t.com...
>I have a C# winforms application that makes periodic web service calls in
background thread to my web service server. These calls work fine almost
all
the time but on rare occassions the web service method call will never
return
and the entire application will freeze, even though the call is being made
on
its own background thread, not the main UI thread.

Does anyone know any reason why a particular web service method call would
cause my entire C# application to lock up and become unresponsive? Again,
this call is initiated on a background thread and this thread does not
interact with the main UI thread at all.
Obviously, there _is_ interaction with the UI thread. This interaction may
not be direct, but if there were no such interaction, I don't see how the UI
thread could freeze.

Does this happen when you run in the debugger? If so, can you break
execution when the freeze happens and use the Call Stack to find out where
the UI thread is blocking?
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Oct 23 '07 #2
I am unable to reproduce this at all either in the debugger or not. This
application runs on about 600 client machines and runs 24x7. The freeze
happens on about 1 machine about every other day.

My web service method is called "heartbeat" and all it does is let my server
know that the client is still alive. The client thread that calls the
heartbeat method does nothing else but call the method, then sleep for 5
minutes, then call it again. It's just a simple loop. It doesn't interact
with the main UI thread.

Other than manipulating a GUI control on the main UI thread, which I know is
bad, is there anything else related to WS calls that might freeze the
application?

Thanks for your help,

Colin

"John Saunders [MVP]" wrote:
"chendricks" <ch********@discussions.microsoft.comwrote in message
news:58**********************************@microsof t.com...
I have a C# winforms application that makes periodic web service calls in
background thread to my web service server. These calls work fine almost
all
the time but on rare occassions the web service method call will never
return
and the entire application will freeze, even though the call is being made
on
its own background thread, not the main UI thread.

Does anyone know any reason why a particular web service method call would
cause my entire C# application to lock up and become unresponsive? Again,
this call is initiated on a background thread and this thread does not
interact with the main UI thread at all.

Obviously, there _is_ interaction with the UI thread. This interaction may
not be direct, but if there were no such interaction, I don't see how the UI
thread could freeze.

Does this happen when you run in the debugger? If so, can you break
execution when the freeze happens and use the Call Stack to find out where
the UI thread is blocking?
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Oct 23 '07 #3
Does it share any resources that are used by other threads? Any variables,
database connections, files or any other resources that you are locking
while this task is processing? It sounds like you could have two threads
that need access to the same shared resource and they are running in to a
deadlocking situation. That would also explain why it's so hard to
reproduce.

--
Andrew Faust
andrew[at]andrewfaust.com
http://www.andrewfaust.com
"chendricks" <ch********@discussions.microsoft.comwrote in message
news:60**********************************@microsof t.com...
>I am unable to reproduce this at all either in the debugger or not. This
application runs on about 600 client machines and runs 24x7. The freeze
happens on about 1 machine about every other day.

My web service method is called "heartbeat" and all it does is let my
server
know that the client is still alive. The client thread that calls the
heartbeat method does nothing else but call the method, then sleep for 5
minutes, then call it again. It's just a simple loop. It doesn't interact
with the main UI thread.

Other than manipulating a GUI control on the main UI thread, which I know
is
bad, is there anything else related to WS calls that might freeze the
application?

Thanks for your help,

Colin

"John Saunders [MVP]" wrote:
>"chendricks" <ch********@discussions.microsoft.comwrote in message
news:58**********************************@microso ft.com...
>I have a C# winforms application that makes periodic web service calls
in
background thread to my web service server. These calls work fine
almost
all
the time but on rare occassions the web service method call will never
return
and the entire application will freeze, even though the call is being
made
on
its own background thread, not the main UI thread.

Does anyone know any reason why a particular web service method call
would
cause my entire C# application to lock up and become unresponsive?
Again,
this call is initiated on a background thread and this thread does not
interact with the main UI thread at all.

Obviously, there _is_ interaction with the UI thread. This interaction
may
not be direct, but if there were no such interaction, I don't see how
the UI
thread could freeze.

Does this happen when you run in the debugger? If so, can you break
execution when the freeze happens and use the Call Stack to find out
where
the UI thread is blocking?
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Oct 30 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sidd | last post by:
Hi all, how do i exit out(unload) of a windows service in case of an error. so i have a code block as follows try { } catch(exception ex) { //log to event log
17
by: Jeremy Chapman | last post by:
I've seen apps where if a windows exe form is running, it publishes a web service. There is no IIS folders or virtual directories required. Does anyone have information on how to do this?
0
by: David Palau | last post by:
We have a internal company WinForms application that makes some calls out to a intranet web service (once at application start-up for some configuration info and then periodically during the life...
17
by: UJ | last post by:
Is there any way for a windows service to start a windows program ? I have a service that will need to restart a windows app if it needs to. TIA - Jeff.
2
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app...
6
by: depalau | last post by:
I'm running into some issues on maintaining a static variable across the lifetime of a web service and I was wondering if anyone could help. Background: We have developed a C#/1.1 web service...
1
by: Andy | last post by:
Hi all, I'm familiar with web service compression and how to implement it in a Winforms app. What I'm trying to figure out how to do at this point is how to consume the service from an ASP.NET...
11
by: Joseph Geretz | last post by:
I've been looking at two approaches for the maintenance of Session state for a Web Service application. One approach uses the old familiar Session object which I've used in the past for Web...
0
by: =?Utf-8?B?QWRyaWFuIENvbGU=?= | last post by:
I have written a simple WCF service hosted in a Windows console application and a simple WCF client console application that connects successfully to that service and retrieves data. I then ported...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.