Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Remoting -how to decide which Delegate i need to Invoke (Private Msgs)

Remoting -how to decide which Delegate i need to Invoke (Private Msgs)

Scheduled Pinned Locked Moved C#
questionsysadmintutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michael cohen
    wrote on last edited by
    #1

    Hello Im writing a simple messenger and im having trouble with the "Private Messages" i worte the shared object between the clinet and the server later all the clients subscribe to the server events Let Say "User Send Message" event Now ,Let say that User "michael" wants to send Message to "liron" So im iterating in server side on each Subscriber , How can i know which of the subscribers are "liron"? can i find any value that identify "liron "?

    UserSendMsgHandler messageDelegate = null;
    Delegate[] invocationList_ = null;
    try
    {
    invocationList_ = onUserSendMsg.GetInvocationList();
    }
    catch
    {

                }
                if (invocationList\_ != null)
                {
                    lock (this)
                    {
                        foreach (Delegate del in invocationList\_)
                        {
                            try
                            {
                                messageDelegate = (UserSendMsgHandler)del;
                                
                                messageDelegate(Msg,Sender,Receivers\[0\]);
                            }
                            catch
                            {
                                onUserSendMsg -= messageDelegate;
                            }
                        }
                    }
                }
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups