This project has moved. For the latest updates, please go here.

Mono IEEE C37.118.2-2011 UDP Socket Problem

Aug 27, 2015 at 1:04 PM
Hi, i have a problem with openPDC in Debian Wheezy:

My PMU are using IEEE C37.118.2-2011 UDP protocol and IPv4 address, they are working on Windows PMU Tester and openPDC Server, but in linux i am receiving this messages on openPDC server console:

[UMRTEST] Attempting connection...
[UMRTEST] Initiating IEEE C37.118.2-2011 UDP based connection...
[UMRTEST] Connection attempt failed: The descriptor is not a socket

PMU Connection String:
transportprotocol=Udp;localport=65000; server=192.168.1.51; remoteport=4712; interface=0.0.0.0

My versions:
Debian - Wheezy (7)
openPDC Server - 2.1.59.0
Mono - 4.0.3
XBuild 12.0
Mysql Server - 5.5
Developer
Sep 1, 2015 at 12:17 PM
I'm sorry to hear you're having trouble with openPDC on Linux!

Debian Wheezy is one of the main platforms we've tested on, so we should be able to get to the bottom of this. Could you attach copy of your openpdc.exe.config file?
Sep 1, 2015 at 12:56 PM
Edited Sep 1, 2015 at 12:56 PM
Coordinator
Sep 19, 2015 at 6:42 PM
I have confirmed UDP sockets on Linux to be an issue - will look into this further. For now you will need to stick with TCP...

Thanks,
Ritchie
Sep 21, 2015 at 4:08 PM
I found a solution to the problem, maybe you can refine better, but for now here it is:

In file gsf/Source/Libraries/GSF.Communication/UdpClient.cs search the line with this code:
m_udpClient.Provider.IOControl(SIO_UDP_CONNRESET, new[] { Convert.ToByte(false) }, null);
and just put the line in a simple try/catch:
try
{
   m_udpClient.Provider.IOControl(SIO_UDP_CONNRESET, new[] { Convert.ToByte(false) }, null);
}
catch {}
And in file gsf/Source/Libraries/GSF.Communication/UdpServer.cs do the same with:
m_udpServer.Provider.IOControl(SIO_UDP_CONNRESET, new[] { Convert.ToByte(false) }, null);
Now:
try
{
   m_udpServer.Provider.IOControl(SIO_UDP_CONNRESET, new[] { Convert.ToByte(false) }, null);
}
catch {}
This fix works for me, now i can use in Debian with Mono.

Error log from openPDC: https://www.dropbox.com/s/1ooflb42apdiqye/ErrorLog.txt?dl=0

Similar bug with same System.Net.Sockets.Socket.IOControl and SIO_UDP_CONNRESET: https://metaverse.atlassian.net/browse/LIBOMV-573
Coordinator
Sep 23, 2015 at 1:06 PM
Nice! Thanks for the catch - want to do a pull request into the GSF repository?

https://github.com/GridProtectionAlliance/gsf

We will merge your fix.

Ritchie
Sep 24, 2015 at 1:14 PM
Coordinator
Sep 24, 2015 at 1:27 PM
Awesome, merged!

Thanks!
Ritchie