473,782 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

accessing properties of remote objects

I have a remote object with a public property (see code below). A client
can use this property to receive a ref to another remote object and use it's
properties.
This works great over a LAN, but over the internet, when the client tries to
use this second object by calling a property or method, the call hangs for
about 30 seconds then throws the following exception:
"A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond"

When I create the initial connection to the remote service
(MyRemoteServic e), it communicates via the ip address and port I specified
in the URI passed to RemotingService s.Connect. But when I then retrieve a
ref to MyRemoteObject and call its methods, what ip address/port is used for
that network communication? I'm guessing it's using another port that is
not open thru a firewall.

---------code-------------------------------------
SERVER:
public class MyRemoteObject : MarshalByRefObj ect
{
public int MyProperty {
get { return 5; }
}
}

public class MyRemoteService : MarshalByRefObj ect
{
public MyRemoteObject RemoteObject {
get { return new MyRemoteObject( ); }
}
}

CLIENT:
public class MyClientApp {
public Run() {
MyRemoteService remSvc =
(MyRemoteServic e)RemotingServi ces.Connect(typ eof(MyRemoteSer vice),
String.Format(" tcp://{0}:{1}/MyRemoteService ", IPAddress, Port));
MyRemoteObject remObj = remSvc.RemoteOb ject;
int remProp = remObj.MyProper ty; //this hangs, then throws
exception
}
}
Jul 22 '05 #1
1 1675
I think something like this is happening:
http://www.glacialcomponents.com/Art...ail/CAOMN.aspx

But please feel free to post more replies if you have any other ideas or
comments!

"Joel Lyons" <NO*********@NO VARAD.NET> wrote in message
news:eE******** ******@TK2MSFTN GP12.phx.gbl...
I have a remote object with a public property (see code below). A client
can use this property to receive a ref to another remote object and use
it's properties.
This works great over a LAN, but over the internet, when the client tries
to use this second object by calling a property or method, the call hangs
for about 30 seconds then throws the following exception:
"A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond"

When I create the initial connection to the remote service
(MyRemoteServic e), it communicates via the ip address and port I specified
in the URI passed to RemotingService s.Connect. But when I then retrieve a
ref to MyRemoteObject and call its methods, what ip address/port is used
for that network communication? I'm guessing it's using another port that
is not open thru a firewall.

---------code-------------------------------------
SERVER:
public class MyRemoteObject : MarshalByRefObj ect
{
public int MyProperty {
get { return 5; }
}
}

public class MyRemoteService : MarshalByRefObj ect
{
public MyRemoteObject RemoteObject {
get { return new MyRemoteObject( ); }
}
}

CLIENT:
public class MyClientApp {
public Run() {
MyRemoteService remSvc =
(MyRemoteServic e)RemotingServi ces.Connect(typ eof(MyRemoteSer vice),
String.Format(" tcp://{0}:{1}/MyRemoteService ", IPAddress, Port));
MyRemoteObject remObj = remSvc.RemoteOb ject;
int remProp = remObj.MyProper ty; //this hangs, then throws
exception
}
}

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2988
by: Jaydeep | last post by:
Hello, I am facing a strange problem. Problem accessing remote database from ASP using COM+ server application having VB components (ActiveX DLL) installed. Tier 1 : ASP front End (IIS 5.0) Tire 2 : COM objects Tier 3 : SQL Server 2000 DB Flow is : ASP talks with COM objects and COM objects talks with DB Scenario 1
2
1833
by: Gijs Beukenoot | last post by:
Hi all, I have an existing application that checks a few things before it launches another application. One thing that the application needs to check is the subscription properties of both the local database and the remote (LAN) server. I've stumbled upon some properties but I am trying to fit in the last ones and I can't seem to find the right code to accomplish this... Can anyone shine a little light on this please ?
1
1947
by: Peter Lorz | last post by:
Hello, I have a simple problem. I got two visual studio projects, one is an application, the other a common windows service. The application needs to get a remote reference of the service. Now the question: How do I get the application-project known to the referenced classtype of the remote object in the service-project ? Thanx for any help!
13
3289
by: Alek Davis | last post by:
Hi, Is it possible to access intrinsic ASP objects, such as Request, from a .NET class. Say, I have a .NET library exposed via a COM or COM+ wrapper. Can this library retrieve the request info (basically, server variables exposed via the Request object), when it is invoked from a traditional ASP (not ASP.NET) application? Any ideas? Thanks in advance. Alek
0
2266
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or updating the code-behind dll) accessing any aspx page in the application causes the application to run for the first time. Some of the initialization involves reading and writing some text and xml files using simple streamreader and streamwriter...
1
267
by: Joel Lyons | last post by:
I have a remote object with a public property (see code below). A client can use this property to receive a ref to another remote object and use it's properties. This works great over a LAN, but over the internet, when the client tries to use this second object by calling a property or method, the call hangs for about 30 seconds then throws the following exception: "A connection attempt failed because the connected party did not properly...
3
2497
by: Fredric Ragnar | last post by:
Hi, I am making a prototype system with Remoting in the bottom of the system. An XML Web Service is using the remote object on an IIS to present data. I am using a TcpChannel for communicating between the XML Web Service and the host for the remote object. Within the host a port is defined and the channel registered. It starts listening for requests. The destination port is therefore clearly defined.
3
1821
by: Jay | last post by:
I created a website in Visual studio 2005. I did a build and I can browse it on my local box. http://localhost/gpweb/gpkey.aspx When I try to access it on a remote box, it doesn't work. http://<myservername>/gpweb/gpkey.aspx I get the "Page cannot be displayed" error.
4
4224
by: Noy B | last post by:
Hi, I have developed a small application that is using a MSAccess DB. the problem is that it was developed on a machine where the application and the DB are both located. now it needs to be change that the application will be able to run on any other machine (using \\ syntax on the run command- not a problem) using the DB located on a static-different machine. for this purpose I need to create a Remote Connection from my
0
9641
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.