Socket.Connect blocks all threads?
#21
Posted 22 July 2011 - 07:36 AM
#22
Posted 22 July 2011 - 01:38 PM
Best bet is to download the .NET MF (4.1 QFE1) source from netmf.codeplex.com and then apply the latest Netduino source as a patch.
You can compile via GCC (free) or RVDS (preferred).
Chris
#23
Posted 22 July 2011 - 01:45 PM
#24
Posted 22 September 2011 - 05:17 AM
#25
Posted 22 September 2011 - 05:40 AM
#26
Posted 22 September 2011 - 01:09 PM
#27
Posted 22 September 2011 - 01:25 PM
Today I have seen 4.2 RC hang with a Socket.Connect() - I modified the send and receive timeouts which had no affect.
I am seeing the same thing on both versions. It is true that sometimes an exception will be generated, but not always. Sometimes it just locks up the entire machine, including all threads. To overcome this and potentially other lockups, I am adding an external watchdog timer chip. My plan is to use the MAX6751 which seems to have everything I need. Adding this chip to my design will be next week's goal. It's a shame that the ARM's built in watchdog timer is not supported.
#28
Posted 22 September 2011 - 01:43 PM
I am seeing the same thing on both versions. It is true that sometimes an exception will be generated, but not always. Sometimes it just locks up the entire machine, including all threads. To overcome this and potentially other lockups, I am adding an external watchdog timer chip. My plan is to use the MAX6751 which seems to have everything I need. Adding this chip to my design will be next week's goal. It's a shame that the ARM's built in watchdog timer is not supported.
Hi Robert,
This is very interesting, we were looking for something like that. Keep us posted if it can work.
Also for making sure a socket.connect timeouts at some point, you might also want to look at this thread. The idea is to create the socket.connect at a thread and then create a "watchdog" thread that sleeps for some time and after that it kills the socket.connect thread.
#29
Posted 22 September 2011 - 01:45 PM
#30
Posted 26 September 2011 - 11:02 PM
#31
Posted 27 September 2011 - 05:13 AM
#32
Posted 02 October 2011 - 08:39 PM
When I read the last few messages before yours, it seems like people are still experiencing problems with 4.2 RC2. If I'm wrong, then I'll be doing my first update too.
Spork, I think you are wrong. I read this thread and the ONLY reference to "RC2" was by ColinR. RC2 firmware was NEVER released and is not planned, afaik. Secretlabs intends to release an RC3 firmware as soon as .NETMF 4.2 is fully and completely released by the .NETMF crew. (Which is about 2 or 3 weeks late! Grrr!)
ColinR is a bit of a pro, I think. He probably constructed his own firmware by patching Microsoft's RC2 release with NetduinoPlus stuff.
ColinR, Where did your "RC2" code come from, exactly? Did you roll-your-own? Are you willing to share?
#33
Posted 03 October 2011 - 05:51 AM
ColinR is a bit of a pro
Hardly! Sorry for the confusion, I went back and checked versions. I'm running NetduinoPlusFirmware_v4.2.0.0_RC1 - with this version exceptions are thrown, and I don't see any hangs of this nature. I can't confirm, but it must have been 4.2 BETA 2 with the connect hangs.
Note: the only hangs I see are on Socket.Poll(SocketPollDuration, SelectMode.SelectWrite)
#34
Posted 29 October 2011 - 02:38 PM
IPHostEntry host_entry = Dns.GetHostEntry(SERVER_IP); IPEndPoint ip = new IPEndPoint(host_entry.AddressList[0], SERVER_PORT); Type socketNative = typeof(NetworkInterface).Assembly.GetType("Microsoft.SPOT.Net.SocketNative"); MethodInfo _connect = socketNative.GetMethod("connect", BindingFlags.Static | BindingFlags.Public); SocketAddress sa = ip.Serialize(); byte[] bsa = new byte[sa.Size]; for (int i = 0; i < bsa.Length; i++) { bsa[i] = sa[i]; } unsafe { _connect.Invoke(null, new object[] { socket, bsa, false }); }
This code works for me to avoid de Socket.Connect probem. Bye !
#35
Posted 22 August 2013 - 06:46 PM
Anybody knows whether these issues are really resolved in 4.3?
#36
Posted 24 August 2013 - 12:46 AM
My solution to this problem ...
Attached Files
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users