.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani

Home >> Code Snippets >> Remoting >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Remoting with VB.NET using HttpChannel

Posted By:nishithraj       Posted Date: November 27, 2009    Points: 10    Category: Remoting    URL: http://www.dotnetspark.com  

We can transmit the remoting object by either TCPChannel or HTTPChannel.
Here I have illustrated with httpchannel. System.Runtime.Remoting.Channels.http is the Name space to be used here.

Here is a sample for remoting using HttpChannel

public shared sub Main()
dim channel as HttpChannel = new HttpChannel()
dim t as Type=Type.GetType("Hi,Hello")
dim url as string ="tcp://localhost:portnumber"
dim obj1 as object=Activator.CreateInstance(t)
Console.WriteLine("Enter Name")
dim str as string=Console.Readline()
end sub

HttpChannel uses SOAPformatter to serialize the message to XML format.
However as a study the highest performance can gain by using the TCP channel and binary serialization with a Windows Service host than a remoting with http. Because in the windows service it transmits with binary data over raw TCP sockets.


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend