Need solution to Socket timeout hang issue - Netduino Plus 2 (and Netduino Plus 1) - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Need solution to Socket timeout hang issue

socket

  • Please log in to reply
2 replies to this topic

#1 lemkepf

lemkepf

    New Member

  • Members
  • Pip
  • 1 posts

Posted 11 November 2013 - 04:06 PM

I have a ND+2 with the latest beta firstware installed. I have my app working great except it hangs at least a few times a day. It's all related to the timeouts with Sockets. 

 

I've seen on a few posts on the forum that mention this issue...  

 

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;font-size:12px;]... i have also found out that there are no Connection [/color][font="helvetica, arial, sans-serif;background-color:#FFFF00;color:#FF0000;font-size:14px;"]Timeout[/font][color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;font-size:12px;] on  "Dns.GetHostEntry("api.pachube.com")" and the "[/color][font="helvetica, arial, sans-serif;background-color:#FFFF00;color:#FF0000;font-size:14px;"]Socket[/font][color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;font-size:12px;].Connect()" - So what you are facing is the [/color][font="helvetica, arial, sans-serif;background-color:#FFFF00;color:#FF0000;font-size:14px;"]timeout[/font][color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;font-size:12px;] problem, (seems like it), because it stops printing out your debug information, but i could be wrong.[/color]

 

The only way i can find to fix the problem is to create a watchdog that need to be triggered after "new Socket(..)" - But that’s not a solution, it’s just a work around and the problem will still exist

 

Do we have an update on when a true solution will be found? I'm guessing that's something that should be put in the netmf code? 

 

In the mean time... A "watchdog" is the solution that I've seen brought up. I'm a bit confused on what that is and how to implement it. 

 

What other solutions have people been using to stop the hang from happening? 

 

Thanks!



#2 Clunis

Clunis

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationItaly

Posted 22 November 2013 - 07:38 PM

Hi, i'm in the same boat, i think one of possible solutions are timers.
 
using (watchDog = new Timer(new TimerCallback(socketTimeout), null, 5000, 0))
{
            sock.Connect(ip);
}
 
something like that...
but i should prefer a way to step over the code and not execute another function...


#3 Duefectu

Duefectu

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 06 December 2013 - 11:58 AM

I open a new thread and connect from this new thread, it hangs the threat, but not the entire program.

However, the ND2 hangs after 1 or 2 days. If I unplug the Network cable it not hangs!







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.