This project has moved and is read-only. For the latest updates, please go here.

Mono IEEE C37.118.2-2011 UDP Socket Problem

Aug 27, 2015 at 2: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=; remoteport=4712; interface=

My versions:
Debian - Wheezy (7)
openPDC Server -
Mono - 4.0.3
XBuild 12.0
Mysql Server - 5.5
Sep 1, 2015 at 1: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 1:56 PM
Edited Sep 1, 2015 at 1:56 PM
Sep 19, 2015 at 7: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...

Sep 21, 2015 at 5: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:
   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);
   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:

Similar bug with same System.Net.Sockets.Socket.IOControl and SIO_UDP_CONNRESET:
Sep 23, 2015 at 2:06 PM
Nice! Thanks for the catch - want to do a pull request into the GSF repository?

We will merge your fix.

Sep 24, 2015 at 2:14 PM
Sep 24, 2015 at 2:27 PM
Awesome, merged!