AllJoynUnity.AllJoyn.SessionPortListener.SessionPortListener C# (CSharp) Method

SessionPortListener() public method

public SessionPortListener ( ) : System
return System
            public SessionPortListener()
            {
                _acceptSessionJoiner = new InternalAcceptSessionJoiner(_AcceptSessionJoiner);
                _sessionJoined = new InternalSessionJoined(_SessionJoined);

                #if UNITY_ANDROID
                _sessionPortListener = alljoyn_unitysessionportlistener_create(this,
                    _acceptSessionJoiner, _sessionJoined);
                #else
                SessionPortListenerCallbacks callbacks;
                callbacks.acceptSessionJoiner = Marshal.GetFunctionPointerForDelegate(_acceptSessionJoiner);
                callbacks.sessionJoined = Marshal.GetFunctionPointerForDelegate(_sessionJoined);

                GCHandle gch = GCHandle.Alloc(callbacks, GCHandleType.Pinned);
                _sessionPortListener = alljoyn_sessionportlistener_create(gch.AddrOfPinnedObject(), IntPtr.Zero);
                gch.Free();
                #endif
            }