Esempio n. 1
0
        /// <summary>
        /// 独立信令 拒绝邀请接口
        /// 拒绝邀请后用户也可以通过加入频道接口加入频道,接口的使用由用户的业务决定
        /// </summary>
        /// <param name="param">拒绝邀请的传入参数</param>
        /// <param name="cb">结果回调见NimSignalingDef.cs</param>
        public static void Reject(NIMSignalingRejectParam param, InviteDelegate cb)
        {
            int    nSizeOfParam = Marshal.SizeOf(param);
            IntPtr param_ptr    = Marshal.AllocHGlobal(nSizeOfParam);

            try
            {
                Marshal.StructureToPtr(param, param_ptr, false);
                var user_ptr = NimUtility.DelegateConverter.ConvertToIntPtr(cb);
                SignalingNativeMethods.nim_signaling_reject(param_ptr, NimSignalingRejectCb, user_ptr);
            }
            catch (Exception ex)
            {
            }
            finally
            {
                Marshal.FreeHGlobal(param_ptr);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 独立信令 拒绝邀请接口
        /// 拒绝邀请后用户也可以通过加入频道接口加入频道,接口的使用由用户的业务决定
        /// </summary>
        /// <param name="param">拒绝邀请的传入参数</param>
        /// <param name="cb">结果回调见NimSignalingDef.cs</param>
        public static void Reject(NIMSignalingRejectParam param, NimSignalingOptRejectHandler cb)
        {
            NIMSignalingRejectParam_C param_c = SignalHelper.GetNativeNIMSignalingRejectParam(param);
            int    nSizeOfParam = Marshal.SizeOf(param_c);
            IntPtr param_ptr    = Marshal.AllocHGlobal(nSizeOfParam);

            try
            {
                Marshal.StructureToPtr(param_c, param_ptr, false);
                var user_ptr = NimUtility.DelegateConverter.ConvertToIntPtr(cb);
                SignalingNativeMethods.nim_signaling_reject(param_ptr, NimSignalingRejectCb, user_ptr);
            }
            catch (Exception)
            {
                cb?.Invoke(NIMSignalingRejectOrAcceptResCode.kAbnormal);
            }
            finally
            {
                Marshal.FreeHGlobal(param_ptr);
            }
        }