Ejemplo n.º 1
0
            private void CreateMeeting(String topic, uint min_atendees, List <String> slots, HashSet <String> invitees)
            {
                SafeSleep();
                try
                {
                    Meeting meeting;

                    if (invitees == null)
                    {
                        meeting = new Meeting(this.ClientId, topic, min_atendees, slots);
                    }
                    else
                    {
                        meeting = new MeetingInvitees(this.ClientId, topic, min_atendees, slots, invitees);
                    }

                    CurrentServer.CreateMeeting(topic, meeting);
                    Console.WriteLine(String.Format("Meeting with topic {0} created at the server", topic));
                    Meetings.Add(topic, meeting);
                    Console.WriteLine(String.Format("Trying to gossip meeting with topic {0}", topic));
                    List <ServerClient> gossipClients = CurrentServer.GetGossipClients(ClientId);
                    Console.WriteLine(String.Format("got {0} clients to gossip meeting with topic {0}", gossipClients.Count, topic));
                    gossipMeeting(gossipClients, meeting, topic);
                    Console.WriteLine(String.Format("meeting with topic {0} gossiped", topic));
                }
                catch (System.Net.Sockets.SocketException)
                {
                    this.ReconnectingClient();
                    this.CreateMeeting(topic, min_atendees, slots, invitees);
                }

                catch (MSDAD.Shared.ServerException e)
                {
                    Console.WriteLine(e.GetErrorMessage());
                }
            }