Example #1
0
        private static void NimSignalingChannelsSyncCallback(IntPtr info_list, int size, IntPtr user_data)
        {
            List <NIMSignalingChannelDetailedinfo> channels = new List <NIMSignalingChannelDetailedinfo>();

            if (info_list != IntPtr.Zero)
            {
                for (int i = 0; i < size; i++)
                {
                    NIMSignalingChannelDetailedinfo channel_detailed_info = new NIMSignalingChannelDetailedinfo();

                    IntPtr detailed_ptr = NimUtility.IntPtrExtensions.Increment(info_list, i * Marshal.SizeOf(typeof(NIMSignalingChannelDetailedinfo_C)));
                    NIMSignalingChannelDetailedinfo_C detailed_info = (NIMSignalingChannelDetailedinfo_C)Marshal.PtrToStructure(detailed_ptr, typeof(NIMSignalingChannelDetailedinfo_C));

                    for (int j = 0; j < detailed_info.member_size_; j++)
                    {
                        IntPtr src_data = NimUtility.IntPtrExtensions.Increment(detailed_info.members_, j * 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);
                        channel_detailed_info.members_.Add(member_info);
                    }

                    channel_detailed_info.channel_info_ = SignalHelper.NIMSignalingChannelInfoFromC(detailed_info.channel_info_);
                    channels.Add(channel_detailed_info);
                }
            }
            NimUtility.DelegateConverter.Invoke <NimSignalingChannelsSyncHandler>(user_data, channels);
        }
        private static void NimSignalingChannelsSyncCallback(IntPtr info_list, int size, IntPtr user_data)
        {
            List <NIMSignalingChannelDetailedinfo> channels = null;

            if (info_list != IntPtr.Zero)
            {
                channels = new List <NIMSignalingChannelDetailedinfo>();
                for (int i = 0; i < size; i++)
                {
                    var ptr = Marshal.ReadIntPtr(info_list, i * Marshal.SizeOf(typeof(IntPtr)));
                    NIMSignalingChannelDetailedinfo detail = new NIMSignalingChannelDetailedinfo();
                    detail.SetData(ptr);
                    channels.Add(detail);
                }
            }
            NimUtility.DelegateConverter.Invoke <NimSignalingChannelsSyncHandler>(user_data, channels);
        }
        private static void NimSignalingMembersSyncCallback(IntPtr detailed_info, IntPtr user_data)
        {
            NIMSignalingChannelDetailedinfo channel_detailed_info = new NIMSignalingChannelDetailedinfo();


            if (detailed_info != IntPtr.Zero)
            {
                NIMSignalingChannelDetailedinfo_C res_param = (NIMSignalingChannelDetailedinfo_C)Marshal.PtrToStructure(detailed_info, typeof(NIMSignalingChannelDetailedinfo_C));
                channel_detailed_info.channel_info_ = SignalHelper.NIMSignalingChannelInfoFromC(res_param.channel_info_);
                for (int i = 0; i < res_param.member_size_; i++)
                {
                    IntPtr src_data = NimUtility.IntPtrExtensions.Increment(res_param.members_, i * Marshal.SizeOf(typeof(NIMSignalingMemberInfo)));
                    NIMSignalingMemberInfo member_info = (NIMSignalingMemberInfo)Marshal.PtrToStructure(src_data, typeof(NIMSignalingMemberInfo));
                    channel_detailed_info.members_.Add(member_info);
                }
            }

            NimUtility.DelegateConverter.Invoke <NimSignalingMembersSyncHandler>(user_data, channel_detailed_info);
        }
 public NIMSignalingJoinResParam()
 {
     info_ = new NIMSignalingChannelDetailedinfo();
 }