Example #1
0
        public void Login(IUserInfo me)
        {
            thisUser = me;

            UnsubscribeChannel();

            channel.MessageReceived += channel_MessageReceived;

            var message = Message.FromSender <LoginMessage>(me);

            channel.MulticastMessage(message);
        }
Example #2
0
        void bridgeHost_PresenceMessageForwarded(object sender, PresenceMessageForwardedEventArgs e)
        {
            if (e.Message.ChannelID == presenceChannel.ChannelID)
            {
                return;                                    // my own message
            }
            if (!targetBridges.Contains(e.BridgeEndPoint)) // not coming from a target bridge list
            {
                return;
            }

            messageInspector.InspectForeignPresenceMessage(e.Message, e.BridgeEndPoint);

            Trace.WriteLine("Replay: " + e.Message.GetType().Name);

            if (e.IsBroadcast)
            {
                ExceptionMonster.EatTheException(() =>
                {
                    presenceChannel.MulticastMessage(e.Message);
                }, "replaying presence message to local clients");
            }
            else
            {
                ExceptionMonster.EatTheException(() =>
                {
                    IPEndPoint endpoint = routeTable.GetLocalPresenceEndPoint(e.Message.Recipient.ClientID);

                    if (endpoint != null)
                    {
                        e.Message.Recipient = new SquiggleEndPoint(e.Message.Recipient.ClientID, endpoint);
                        presenceChannel.SendMessage(e.Message);
                    }
                }, "routing presence message to local user");
            }
        }
Example #3
0
 void ImAlive()
 {
     channel.MulticastMessage(keepAliveMessage);
 }