lnobad / lidgren-network-gen3

Automatically exported from code.google.com/p/lidgren-network-gen3
0 stars 0 forks source link

System.NotSupportedException on Mono/Mac #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When trying to test Lidgren under Mono on a Mac, I received the following 
exception:

Unhandled Exception: System.NotSupportedException: This platform is not 
supported
  at System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties () [0x00000] in <filename unknown>:0 
  at Lidgren.Network.NetUtility.GetNetworkInterface () [0x00000] in <filename unknown>:0 
  at Lidgren.Network.NetUtility.GetMacAddress () [0x00000] in <filename unknown>:0 
  at Lidgren.Network.NetPeer.InitializeNetwork () [0x00000] in <filename unknown>:0 
  at Lidgren.Network.NetPeer.Start () [0x00000] in <filename unknown>:0 
  at ClientModule.Main (System.String[] argv) [0x00000] in <filename unknown>:0 

(this is a MacBook Air running OS X 10.6.5, with Mono 2.8.1)

Having looked briefly at the Mono source code for IPGlobalProperties, it 
appears that Mono will always raise this exception under Mac OS X, rather than 
returning null. I suppose the solution is to add a try/catch inside 
Lidgren.Network.NetUtility.GetNetworkInterface?

Original issue reported on code.google.com by swiftcoder on 24 Dec 2010 at 2:21

GoogleCodeExporter commented 9 years ago
There's a #define to remove it; but catching the exception still seems like a 
good idea; added in revision 171 - thanks!

Original comment by lidg...@gmail.com on 24 Dec 2010 at 8:05