コード例 #1
0
        private static void NimSignalingOptCallCallback(int code, IntPtr opt_res_param, IntPtr user_data)
        {
            NIMSignalingCallResParam call_res_param = new NIMSignalingCallResParam();

            call_res_param.info_ = new NIMSignalingChannelDetailedinfo();
            NIMSignalingJoinResParam_C res_param_c = (NIMSignalingJoinResParam_C)Marshal.PtrToStructure(opt_res_param, typeof(NIMSignalingJoinResParam_C));

            if (res_param_c != null)
            {
                call_res_param.info_.channel_info_ = SignalHelper.NIMSignalingChannelInfoFromC(res_param_c.info_.channel_info_);
                for (int i = 0; i < res_param_c.info_.member_size_; i++)
                {
                    IntPtr src_data = NimUtility.IntPtrExtensions.Increment(res_param_c.info_.members_, i * Marshal.SizeOf(typeof(NIMSignalingMemberInfo_C)));
                    NIMSignalingMemberInfo_C member_info_c = (NIMSignalingMemberInfo_C)Marshal.PtrToStructure(src_data, typeof(NIMSignalingMemberInfo_C));
                    NIMSignalingMemberInfo   member_info   = SignalHelper.NIMSignalingMemberFromC(member_info_c);


                    call_res_param.info_.members_.Add(member_info);
                }
            }

            NIMSignalingCallResCode res_code = NIMSignalingCallResCode.kUnknown;

            try
            {
                res_code = (NIMSignalingCallResCode)Enum.Parse(typeof(NIMSignalingCallResCode), code.ToString());
            }
            catch
            {
                res_code = NIMSignalingCallResCode.kUnknown;
            }

            NimUtility.DelegateConverter.Invoke <NimSignalingOptCallHandler>(user_data, res_code, call_res_param);
        }
コード例 #2
0
        private void NimSignalingOptCallCallback(NIMSignalingCallResCode code, NIMSignalingCallResParam opt_res_param)
        {
            string info = string.Format("signal call  cb code:{0},channel_ext:{1},creator:{2},cid:{3},invide:{4}", code,
                                        opt_res_param.info_.channel_info_.channel_ext_,
                                        opt_res_param.info_.channel_info_.creator_id_,
                                        opt_res_param.info_.channel_info_.channel_id_,
                                        opt_res_param.info_.channel_info_.invalid_);

            PrintInfo(info);
        }