示例#1
0
        //get meeting
        public bool sendMeeting(MeetingProposal meeting)
        {
            if (server.freeze)
            {
                return(false);
            }
            Log.Debug("received meeting {topic} version {v}", meeting.topic, meeting.version);
            server.randomSleep();
            //check version here?
            if (server.meetingList.ContainsKey(meeting.topic))
            {
                //server has meeting, check version and if meeting is blocked
                //FIXME > vs >=
                //FIXME closed vs open
                if (server.meetingList[meeting.topic].version >= meeting.version ||
                    server.blockedMeetings.ContainsKey(meeting.topic))
                {
                    //current meeting is newer or is blocked
                    return(false);
                }
            }
            server.blockedMeetings.Add(meeting.topic, meeting);
            Thread t = new Thread(() => meetingTimeOut(meeting));

            t.Start();
            return(true);
        }