Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

System.Net.Sockets.SocketException fix

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.
posixx
Posts: 4
Joined: Thu Jan 05, 2017 7:31 pm
Weather Station: Davis Vatage Pro2
Operating System: Windows 10

System.Net.Sockets.SocketException fix

Postby posixx » Tue May 02, 2017 8:55 am

Hello Steve,

Currently i'm running cumulusmx connected to a Davis VantagePro2 through the weatherenvoy with IP Datalogger. CumuluxMX is very stable; the only problem i have is that sometimes (random periods, can work for several days, but can also happen within the hour) i get a socketexception as displayed below:

2017-04-24 18:20:47.533 !!! loop data not received
2017-04-24 18:20:48.554 System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at CumulusMX.DavisStation.SendLoopCommand(TcpClient tcpPort, String commandString) in C:\Users\steve\Documents\Visual Studio 2015\Projects\CumulusMX\CumulusMX\DavisStation.cs:line 766
at CumulusMX.DavisStation.Start() in C:\Users\steve\Documents\Visual Studio 2015\Projects\CumulusMX\CumulusMX\DavisStation.cs:line 575
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

When i restart CumulusMX manually it will connect again succesfully. The reason for the disconnected are most probably because currently the IP datalogger is connected trhough a VPN to the CumulusMX PC, and there can be a hickup once in a while. But i think this problem can be solved easily by modifying your try / catch block within DaviStation.cs, catching the System.IO.IOException specifically and restart the data loop / thread from there. I would add a configurable retry maximum so it's not constantly restarting the loop if the connection is lost for some reason.

Would this be something you are willing to add to the source? Currently i have to monitor the interface often to see it the station is still connected. The above addition would make cumulus a lot more stable for these IP-connected scenario's.

Regards,

Frans

User avatar
steve
Cumulus Author
Posts: 26297
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: On tour in Spain
Contact:

Re: System.Net.Sockets.SocketException fix

Postby steve » Tue May 02, 2017 9:24 am

See various other threads where a few people have the same problem with their system. It's on the to-do list, hopefully in the next build, but I can't say when that will be.
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

posixx
Posts: 4
Joined: Thu Jan 05, 2017 7:31 pm
Weather Station: Davis Vatage Pro2
Operating System: Windows 10

Re: System.Net.Sockets.SocketException fix

Postby posixx » Tue May 02, 2017 9:42 am

Steve,

Sorry i didn't find the problem in other threads otherwise i would post to these. Good to hear it's on the to-do list. If you need any help let me know i'm i .NET developer myself.

Frans

richard_newberry
Posts: 265
Joined: Tue Apr 12, 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Stretch (VMWARE Esxi 6.5)
Location: Leicester
Contact:

Re: System.Net.Sockets.SocketException fix

Postby richard_newberry » Wed May 24, 2017 8:43 pm

I'll hold you to that mate. find out why mono 4.6.2 don't work on cumulus.

debian stretch is nearly released and mono 4.6.2 comes with it as default.

Cheers
Desford Weather
http://www.desford-weather.co.uk
http://desford-weather.co.uk
Also on Desford weather underground.
Looking forward to cumulus on Linux platform it'll rock!!


Return to “Cumulus MX”

Who is online

Users browsing this forum: No registered users and 5 guests