zeromq / clrzmq4

ZeroMQ C# namespace (.NET and mono, Windows, Linux and MacOSX, x86 and amd64)
GNU Lesser General Public License v3.0
241 stars 112 forks source link

detect iOS using loaded assemblies #45

Closed gillima closed 8 years ago

gillima commented 8 years ago

Type.GetType() is only working with full qualified type names including assembly etc. For types located in mscorlib the assembly name is not needed. See MSDN.

The code will no check for the existens of the monotouch or Xamarin.iOS assemblies. Monotouch is the legacy API. Xamarin.iOS is for the new unified API that has been released with Xamarin.iOS 8.6. For more infos about the different API's see Xamarin

metadings commented 8 years ago

Well that's okay, I just need to move the AppDomain.CurrentDomain.GetCurrentAssemblies() into the static constructor, to not enumerate all the assemblies every time I need IsXamarinIOS...

Does this allow me to ask also for Xamarin.Android? Also, what's the assembly name of the Xamarin.iOS type?

gillima commented 8 years ago

The assembly name where the namespace Xamarin.iOS is located is Xamarin.iOS (see my PR). There is no type Xamarin.iOS...

You can also check the same way for Xamarin.Android but I don't have a Xamarin licence to build for Android :-O. Also I don't know if it's really needed to link statically for Android, so I would not include this in the code until someone can test it...

metadings commented 8 years ago

AHA... Now try again!

gillima commented 8 years ago

YEAH :-) Works like a charm!

Notes for usage:

metadings commented 8 years ago

:+1:

Please beware that on Posix systems like iOS and ubuntu GNU/Linux, you must run sudo YourApp.exe, because your application needs root access for the ports 1 - 1024...

So if you are using a port higher than 1024, does ZSocket.Bind really not work on iOS?

gillima commented 8 years ago

Our port is >1024 - will check this later.

metadings commented 8 years ago

:+1: