System.Runtime.Remoting.Channels.Tcp.TcpChannel.GetUrlsForUri C# (CSharp) Method

GetUrlsForUri() private method

private GetUrlsForUri ( String objectURI ) : String[]
objectURI String
return String[]
        public String[] GetUrlsForUri(String objectURI)
        {
            if (_serverChannel != null)
                return _serverChannel.GetUrlsForUri(objectURI);
            else
                return null;
        } // GetUrlsforURI

Usage Example

示例#1
0
		[Test] // TcpChannel (IDictionary, IClientChannelSinkProvider, IServerChannelSinkProvider)
		public void Constructor3 ()
		{
			const string SERVICE_URI = "MarshalSvc";
			string [] urls;
			ChannelDataStore ds;
			TcpChannel chn;

			MarshalObject marshal = new MarshalObject ();

			IDictionary props = new Hashtable ();
			props ["name"] = "marshal channel";
			props ["port"] = 1236;
			props ["bindTo"] = IPAddress.Loopback.ToString ();
			chn = new TcpChannel (props, null, null);

			ChannelServices.RegisterChannel (chn);

			Assert.AreEqual ("marshal channel", chn.ChannelName, "#A1");
			urls = chn.GetUrlsForUri (SERVICE_URI);
			Assert.IsNotNull (urls, "#A2");
			Assert.AreEqual (1, urls.Length, "#A3");
			Assert.AreEqual ("tcp://" + IPAddress.Loopback.ToString () + ":1236/" + SERVICE_URI, urls [0], "#A6");
			ds = chn.ChannelData as ChannelDataStore;
			Assert.IsNotNull (ds, "#A4");
			Assert.AreEqual (1, ds.ChannelUris.Length, "#A5");
			Assert.AreEqual ("tcp://" + IPAddress.Loopback.ToString () + ":1236", ds.ChannelUris [0], "#A6");

			ChannelServices.UnregisterChannel (chn);
			
			chn = new TcpChannel ((IDictionary) null, null, null);

			ChannelServices.RegisterChannel (chn);

			Assert.AreEqual ("tcp", chn.ChannelName, "#B1");
			urls = chn.GetUrlsForUri (SERVICE_URI);
			Assert.IsNull (urls, "#B1");
			ds = chn.ChannelData as ChannelDataStore;
			Assert.IsNull (ds, "#B2");

			ChannelServices.UnregisterChannel (chn);
		}
All Usage Examples Of System.Runtime.Remoting.Channels.Tcp.TcpChannel::GetUrlsForUri