Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / October 2006

Tip: Looking for answers? Try searching our database.

Remoting: Connection Refused (Server to Client)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Norman Chong - 19 Oct 2006 14:27 GMT
Hey ho,

This is a question that I have already posted, but received no valuable
anser... So maybe I have more luck this time :-)

I have a (hopefully) little problem with remoting:
I'm currently developing an application (VB.NET) which should execute
some methods on a different client within the LAN. So I wrote this
little piece of code for testing purposes:

Public Class RemoteObject
   Inherits MarshalByRefObject

   Function Show() As String
       Return "test"
   End Function
End Class

Public Class RemotingServer
   Sub New()
       Dim provider As New BinaryServerFormatterSinkProvider()
       Dim client As New BinaryClientFormatterSinkProvider()
       provider.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
       Dim props As Collections.IDictionary
       props = New Hashtable()
       props.Add("port", "1234")

       Dim serverchannel As TcpChannel(props, client, provider)
       ChannelServices.RegisterChannel(serverchannel, True)

       Dim oType As System.Type = (New RemoteObject).GetType

Remoting.RemotingConfiguration.RegisterWellKnownServiceType(oType, _
           "RemoteObject.Soap",
Remoting.WellKnownObjectMode.Singleton)
   End Sub

   Sub checkClient()
       Dim oType As System.Type = (New RemoteObject).GetType
       Dim obj As RemoteObject = CType(Activator.GetObject
             (oType, "tcp://localhost:1234/RemoteObject.soap"),
RemoteObject)

       MessageBox.Show(obj.Show)
   End Sub
End Class

This works fine until I change 'localhost' to a name of a 'real' client

- Then I get an error which says that the connection has been refused.
So what I want is this: checkClient() should execute the method .Show()

on the client

Can anybody help me to correct and improve my code???

Thanx
Norman
SenthilVel - 24 Oct 2006 08:50 GMT
Hi

The connection refused generally occurs when the remotable service is not up
and runnning.

Thanks
Senthil
http://dotnetcrunch.blogspot.com

> Hey ho,
>
[quoted text clipped - 55 lines]
> Thanx
> Norman

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.