Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 7th, 2005, 01:23 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Remoting

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.

  #2 (permalink)  
Old June 29th, 2005, 06:59 AM
Friend of Wrox
 
Join Date: Sep 2004
Location: , , India.
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i feel that in the uri ur given localhost and that is the problem just debug ur code and tell where it is giving err (line)..



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remoting in C# mahen_pali C# 2005 1 February 24th, 2009 05:15 PM
Remoting in c# mahen_pali C# 0 November 17th, 2008 10:17 AM
Remoting bhavana .NET Framework 1.x 0 November 12th, 2007 04:20 AM
remoting caribbean Pro VB.NET 2002/2003 0 May 16th, 2006 12:11 PM
Remoting.... kk_katepally General .NET 0 December 21st, 2004 05:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.