Hi Girikrishna,

Here I have some code that gives info about
the clients that are subscribed to an event named BroadcastStorage.
I have no time now to explain it, hope the code is selfexplaining,
suitable & adaptable for your needs...

HTH
//Ryan

public string[] Clients()
{
  Delegate[] list = BroadcastStorage.GetInvocationList();
  string [] clients = new string[ list.Length];
  for( int i = 0; i < list.Length; i++)
  {
    try
    {
      clients[i] =  i.ToString() + ": clientinfo ->\n";
      ObjRef objRef = RemotingServices.GetObjRefForProxy(
(MarshalByRefObject)list[i].Target);
      for ( int j = 0; j < objRef.ChannelInfo.ChannelData.Length; j++)
      {
        System.Runtime.Remoting.Channels.ChannelDataStore ds =
objRef.ChannelInfo.ChannelData[j] as
System.Runtime.Remoting.Channels.ChannelDataStore;
        if ( ds == null)
        {
          clients[i] += "    " + j.ToString() + ": not a
ChannelDataStore\n";
        }
        else
        {
          string[] uris = ds.ChannelUris;
          if ( uris == null)
          {
            clients[i] += "    " + j.ToString() + ": has no uris\n";
          }
          else
          {
            foreach( string uri in uris)
            {
              clients[i] += "      " + j.ToString() + ": " + uri + "\n";
            }
          }
        }
      }
    }
    catch( Exception e)
    {
      clients[i] += e.Message + "\n";
    }
  }

  return clients;
}


-------------------------------------
The information included in this message is personal and/or confidential and
intended exclusively for the addressees as stated. This message and/or the
accompanying documents may contain confidential information and should be
handled accordingly. If you are not the intended reader of this message, we
urgently request that you notify Centric immediately and that you delete
this e-mail and any copies of it from your system and destroy any printouts
immediately.
It is forbidden to distribute, reproduce, use or disclose the information in
this e-mail to third parties without obtaining prior permission from
Centric. We expressly point out that there are risks associated with the use
of e-mail. Centric and the companies within the group shall not accept any
liability whatsoever for damage resulting from the use of e-mail. Legally
binding obligations can only arise for Centric by means of a written
instrument, signed by an authorized representative of Centric.
-------------------------------------

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to