IChannelSender Interface
.NET Framework 3.0
Provides required functions and properties for the sender channels.
Namespace: System.Runtime.Remoting.Channels
Assembly: mscorlib (in mscorlib.dll)
Assembly: mscorlib (in mscorlib.dll)
'Declaration <ComVisibleAttribute(True)> _ Public Interface IChannelSender Inherits IChannel 'Usage Dim instance As IChannelSender
/** @attribute ComVisibleAttribute(true) */ public interface IChannelSender extends IChannel
ComVisibleAttribute(true) public interface IChannelSender extends IChannel
Not applicable.
Imports System Imports System.Collections Imports System.Runtime.Remoting Imports System.Runtime.Remoting.Channels Imports System.Runtime.Remoting.Messaging Imports System.Runtime.Remoting.Channels.Http Imports System.Security.Permissions Public Class MyClient <PermissionSet(SecurityAction.LinkDemand)> _ Public Shared Sub Main() Try ' Create the 'IDictionary' to set the server object properties. Dim myDictionary As New Hashtable() myDictionary("name") = "HttpClientChannel" myDictionary("priority") = 2 ' Set the properties along with the constructor. Dim myIChannelSender As New HttpClientChannel(myDictionary, _ New BinaryClientFormatterSinkProvider()) ' Register the server channel. ChannelServices.RegisterChannel(myIChannelSender) Dim myHelloServer1 As MyHelloServer = CType(Activator.GetObject(GetType(MyHelloServer), _ "http://localhost:8085/SayHello"), MyHelloServer) If myHelloServer1 Is Nothing Then Console.WriteLine("Could not locate server") Else Console.WriteLine(myHelloServer1.myHelloMethod("Client")) ' Get the name of the channel. Console.WriteLine("Channel Name :" + myIChannelSender.ChannelName) ' Get the channel priority. Console.WriteLine("ChannelPriority :" + myIChannelSender.ChannelPriority.ToString()) Dim myString As String = "" Dim myObjectURI1 As String = "" Console.WriteLine("Parse :" + myIChannelSender.Parse("http://localhost:8085/SayHello", _ myString) + myString) ' Get the channel message sink that delivers message to specified url. Dim myIMessageSink As IMessageSink = _ myIChannelSender.CreateMessageSink("http://localhost:8085/NewEndPoint", _ Nothing, myObjectURI1) Console.WriteLine("Channel message sink used :" + CType(myIMessageSink,Object).ToString()) Console.WriteLine("URI of new channel message sink :" + myObjectURI1) End If Catch ex As Exception Console.WriteLine("Following exception is raised on client side : " + ex.Message) End Try End Sub 'Main End Class 'MyClient
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: