http://bugs.winehq.org/show_bug.cgi?id=32310
Bug #: 32310 Summary: EVEMon needs System.Net.NetworkInformation.NetworkChange implementation Product: Wine Version: 1.5.18 Platform: x86 URL: http://evemon.battleclinic.com/ OS/Version: Linux Status: NEW Keywords: download Severity: normal Priority: P2 Component: mscoree AssignedTo: wine-bugs@winehq.org ReportedBy: madewokherd@gmail.com Classification: Unclassified
To reproduce, install EVEMon without .NET, and try to run it.
It crashes on startup with an exception: System.EntryPointNotFoundException: CreateNLSocket at (wrapper managed-to-native) System.Net.NetworkInformation.NetworkChange:CreateNLSocket () at System.Net.NetworkInformation.NetworkChange.EnsureSocket () [0x00000] in <filename unknown>:0 at System.Net.NetworkInformation.NetworkChange.Register (System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler d) [0x00000] in <filename unknown>:0 at System.Net.NetworkInformation.NetworkChange.add_NetworkAvailabilityChanged (System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler value) [0x00000] in <filename unknown>:0 at EVEMon.Common.Net.NetworkMonitor.Initialize () [0x00000] in <filename unknown>:0 at EVEMon.Common.EveMonClient.Initialize () [0x00000] in <filename unknown>:0 at EVEMon.Program.Main () [0x00000] in <filename unknown>:0
CreateNLSocket is an entry point into the MonoPosixHelper library. AFAICT it's only implemented on Unix-like systems and would not be possible to implement on Windows. So we need an alternative implementation of System.Net.NetworkInformation.NetworkChange that's based on the Windows API.
Probably the NotifyAddrChange function could be used to detect changes, using System.Threading.AutoResetEvent and ThreadPool.RegisterWaitForSingleObject to get the event notification into the .NET world.
I think this would be a good introduction to Mono development, if anyone needs one.