Wrox Programmer Forums
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 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
 
Old May 9th, 2005, 11:23 PM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default .NET 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.






Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET Remoting vikyjain General .NET 0 March 7th, 2005 12:50 AM
.NET Remoting application in vb.net Tek4VB .NET Web Services 6 November 19th, 2003 09:59 AM
Remoting (.Net) Indian Ocean .NET Web Services 6 November 12th, 2003 03:27 PM
.Net Remoting. kpphani .NET Web Services 5 August 1st, 2003 10:37 AM
.NET Enterprise Development in VB.NET Remoting burkert All Other Wrox Books 0 June 24th, 2003 09:04 AM





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