Example #1
0
        /// <summary>
        /// Create Domain Participant
        /// </summary>
        /// <param name="partitionName">Create the participant and assign the partition name.</param>
        public void createParticipant(String partitionName)
        {
            dpf   = DomainParticipantFactory.Instance;
            dpQos = new DomainParticipantQos();
            dpf.GetDefaultParticipantQos(ref dpQos);

            ErrorHandler.checkHandle(dpf, "DomainParticipantFactory.Instance");

            participant = dpf.CreateParticipant(null, dpQos);
            ErrorHandler.checkHandle(participant, "DomainParticipantFactory.CreateParticipant");
            this.partitionName = partitionName;
        }
        private static void RegisterDomain(Topic <T> topicInstance, string domain)
        {
            lock (_locker)
            {
                DomainParticipantFactory dpf = DomainParticipantFactory.Instance;
                ErrorHandler.CheckHandle(dpf, "DDS.DomainParticipantFactory.Instance");
                var dpQos = new DomainParticipantQos();
                dpf.GetDefaultParticipantQos(ref dpQos);
                topicInstance.Participant = dpf.CreateParticipant(domain, dpQos) ??
                                            (dpf.LookupParticipant(domain) ?? dpf.CreateParticipant(domain, dpQos));

                if (topicInstance.Participant == null)
                {
                    throw new Exception("DDS NOT started, please start / restart your DDS!");
                }
            }
        }