Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Timeouts in SyncBrowse, SyncSearch, etc?
24-06-2013, 06:38 PM
Post: #1
Timeouts in SyncBrowse, SyncSearch, etc?
Hi everyone,

I have been using the C#/.NET version of the ohNet API for the past few months. For the most part, my code is stable and working as intended. I recently received a report that the code exhibited a hang of some kind, but so far we have not been able to reproduce this issue. It occurred to me that the functions SyncBrowse or SyncSearch (in ContentDirectory1) might get stuck. I'm wondering, do these functions have a timeout? If so, how long is it? Is it possible to enable/disable timeouts or adjust their duration?

Looking at the source code for the C# proxies...

http://www.openhome.org/build/nightly/do...ource.html

... I can see that all of the Sync functions involve a semaphore wait with infinite duration, but I don't know if the underlying web services (?) have some kind of network timeout. I know I'm shooting in the dark, but it would help if I could either rule out ohNet Sync calls as a problem, or add code to guard against such problems in shipping code. Any clues would be most welcome.

Thanks,

Don
Find all posts by this user
25-06-2013, 08:47 AM
Post: #2
RE: Timeouts in SyncBrowse, SyncSearch, etc?
(24-06-2013 06:38 PM)doncross Wrote:  I have been using the C#/.NET version of the ohNet API for the past few months. For the most part, my code is stable and working as intended. I recently received a report that the code exhibited a hang of some kind, but so far we have not been able to reproduce this issue. It occurred to me that the functions SyncBrowse or SyncSearch (in ContentDirectory1) might get stuck. I'm wondering, do these functions have a timeout? If so, how long is it? Is it possible to enable/disable timeouts or adjust their duration?

Hi Don

There are timeouts applied to tcp connect and to reading the action response.

There is no explicit timeout for the action request being written so this could block in theory, at least until the network stack on either control point or device timed out. I'd have thought this was very unlikely however; the control point would only block if the SOAP message was larger than the device's receive buffer and messages for most actions would comfortably fit into the 8k default receive buffer for a tcp socket.

So, it is possible but pretty unlikely that sync actions are causing your hang. I'd guess that a deadlock - either in ohNet and/or your code - is a more likely cause.
Find all posts by this user
28-06-2013, 05:04 PM (This post was last modified: 28-06-2013 07:17 PM by ChriD.)
Post: #3
RE: Timeouts in SyncBrowse, SyncSearch, etc?
i got the same Problem of "stuck Sync" Methods. Most time this happens when i call them in a loop. This wont happen with Async Methods, but then of course the sequence can be corrupted;
Find all posts by this user
28-06-2013, 10:21 PM
Post: #4
RE: Timeouts in SyncBrowse, SyncSearch, etc?
(28-06-2013 05:04 PM)ChriD Wrote:  i got the same Problem of "stuck Sync" Methods. Most time this happens when i call them in a loop. This wont happen with Async Methods, but then of course the sequence can be corrupted;

I'd like to investigate this. Do you have any example program that (eventually) demonstrates the problem?
Find all posts by this user


Forum Jump: