hi,
i am using Remoting in
VB.NET. I am using the same example givin in Wrox's Professional
VB.NET 2003. The problem is if i am running Service DLL, Host Application and Client Application in the same computer then it is working fine. But if i am running client on other computer then an error is occuring the "Host is not listening". Both the computer in windows based LAN, their name is M10,M6. And amongst any of them are not Server. Server name is "TATASRV" and host application and service DLL are not on it they are in M10. Following is the code.
SimpleLibrary.DLL(Service DLL )
*************************************
Public Class Calculator
Inherits MarshalByRefObject
Public Function GetThreadID() As Integer
Return AppDomain.GetCurrentThreadId
End Function
Public Function Add2Numbers(ByVal A As Integer, ByVal B As Integer) As Long
Return A + B
End Function
End Class
*************************************
SimpleServer(Host Application)
*************************************
Imports System.Runtime.Remoting
Imports SimpleLibrary
Module Module1
Sub Main()
RemotingConfiguration.RegisterWellKnownServiceType (GetType(SimpleLibrary.Calculator), "Calculator.rem", WellKnownObjectMode.SingleCall)
Channels.ChannelServices.RegisterChannel(New Channels.Tcp.TcpServerChannel(49341))
Console.Write("Press <Enter> to exit")
Console.Read()
End Sub
End Module
*************************************
SimpleClient(Client Application)
*************************************
Private Sub connect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles connect.Click
RemotingConfiguration.RegisterWellKnownClientType( GetType(SimpleLibrary.Calculator), "http://localhost/SimpleHost/Calculator.rem")
remote.Enabled = True
connect.Enabled = False
End Sub
Private Sub remote_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles remote.Click
Dim c As New SimpleLibrary.Calculator()
txt2.Text = c.GetThreadID
End Sub
*************************************
Please help me out.