Main Site Documentation

EMX Socket - SetSocketOption



I have started moving my application from 4.1 to 4.2 but am having an issue with SetSocketOption. Basically anytime I call this command an exception gets thrown.

Any ideas?



Sorry, meant to post this in the system-on-modules sub page.


sorry if you have done this already but have you removed and re added all your references? I remember seeing something somewhere that moving from 4.1 to 4.2 you had to do this.


Thanks for the reply.

I have actually just moved to a new machine so was a fresh install of visual studio, micro framework 4.2 and GHI libraries 4.2. The project was created new and I simply added in my previous cs files, so all references are new. The project builds fine, it is just during runtime when it gets to any line calling SetSocketOption that an exception gets thrown. The code all worked fine in 41.


lots of network changes in 4.2. You’d better go back to the reference documentation for 4.2.


@ Chris_MC -

It would help if you created a small program that displays the problem and posted it.


Thanks for the responses.

Looking about the forum I have found this thread:

In it, people mention having issues with the line: SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, multicastOpt) which is what I am having.

I know not too long ago there were issues with UDP in 4.2 that were fixed, but is there still issues with UDP multicast?


andre.m - do you mean using 4.2?

Multicast works grand for me on the EMX with 4.1.


Hi Andre,

Is this a Microsoft issue or GHI?


I would like to hear from GHI and there thoughts on were the issue with multicast lies? I have been waiting a long time to upgrade to 4.2, but if multicast is currently broken then this again will have to be put on hold.


We simply did not look into it yet. This is an important feature but we have higher priority tasks for the SDK. You can see the numerous fixes we did in last SDK and there are few in this coming SDK.

Note that multicast may have a workaround, we did not confirm this issue yet. We are also fixing many little issues around TCP/IP so the multicast issue may just get fixed automatically, if not already.

I will forward this ot our team, maybe they can squeeze it into this coming SDK.


Multicast is not fixed on the latest SDK, please fix it…

Thank you…


We found the issue yesterday and it is fixed


yay can we the insiders test it; I already have the right program to test it for sure remember the NETMF UPNP…it’s been on back log for a long while now waiting for this fix.

thanks for the update.


Much changed so the firmware itself won’t help, you need the whole SDK, which is not ready.