Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

TcpServerChannel.GetUrlsForUri Method

Returns an array of all the URLs for an object with the specified URI, hosted on the current TcpChannel instance.

Namespace:  System.Runtime.Remoting.Channels.Tcp
Assembly:  System.Runtime.Remoting (in System.Runtime.Remoting.dll)

[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure, 
	Infrastructure = true)]
public virtual string[] GetUrlsForUri(
	string objectUri
)

Parameters

objectUri
Type: System.String

The URI of the object for which URLs are required.

Return Value

Type: System.String[]
An array of the URLs for an object with the specified URI, hosted on the current TcpChannel instance.

Implements

IChannelReceiver.GetUrlsForUri(String)

The following code example shows the use of the GetUrlsForUri method.

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels.Tcp;

class Class1 {
   public static void Main() {

      // Create a remotable object.
      TcpServerChannel tcpChannel = new TcpServerChannel(8085);

      WellKnownServiceTypeEntry WKSTE = 
         new WellKnownServiceTypeEntry(typeof(HelloService),
                                       "Service", 
                                       WellKnownObjectMode.Singleton);
      RemotingConfiguration.RegisterWellKnownServiceType(WKSTE);

      RemotingConfiguration.ApplicationName = "HelloServer";

      // Print out the urls for the HelloServer. 
      string[] urls = tcpChannel.GetUrlsForUri("HelloServer");

      foreach (string url in urls)
         System.Console.WriteLine("{0}", url);

   }
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft