nullreference of system.net.sockets on monotouch

351 views Asked by At

I have three versions of the same application: iPhone, Mono Console, Windows Console application. All of them contain exactly the same code (via MonoTouch C#). On the Mono(Touch) framework I get the following exception from the Assembly Browser: (Windows works perfectly)

System.NullReferenceException: Object reference not set to an instance of an object
  at System.Net.Sockets.Socket+SocketAsyncResult.Complete () [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:240
  at System.Net.Sockets.Socket+SocketAsyncResult.Complete (System.Exception e) [0x00007] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:304
  at System.Net.Sockets.Socket+Worker.Accept () [0x00077] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:510
  at System.Net.Sockets.Socket+Worker.DispatcherCB (System.Net.Sockets.SocketAsyncResult sar) [0x0009e] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:432

Are there any known problems using System.Net.Sockets on MonoTouch? Does anyone know what this exception means (besides the obvious NullReference)? I'm very new to this area. Hopefully someone can point me in the right direction.

2

There are 2 answers

4
Rolf Bjarne Kvinge On BEST ANSWER

This isn't a problem with MonoTouch, but with MonoDevelop.

I suggest filing a bug here: http://bugzilla.xamarin.com so the appropriate people can look at it.

This bug will not prevent you from using MonoTouch (just don't use the Assembly Browser for the assemblies that causes this, you can view the source code directly here instead: https://github.com/mono/mono/tree/mono-2-10).

0
alex On

Bug that looks similar to your problem is registered in Mono's bugzilla at https://bugzilla.xamarin.com/show_bug.cgi?id=2965 . At the moment of writing there was a proposed fix for the Mono framework, but the bug still was not marked as closed or resolved.