?
Solved

Determining Failure on .NET Remoting question

Posted on 2003-10-26
11
Medium Priority
?
639 Views
Last Modified: 2012-06-27
I have a object that is remotely hosted on a server.  I have multiple questions:

1.  If a call to the server (via method call on the remoting object) makes the server hang, the client hangs, is there a way to set a timeout on a remoting call, or will I have to watch it in a seperate thread?

2.  If a call to the server (via method call on the remoting object) throws an exception, is there a way to check whether this is due to the client not having an internet connection or the server being down?  Basically, is there an easy way to determine if the client has an interent connection up and running?  
0
Comment
Question by:jjacksn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
11 Comments
 
LVL 10

Expert Comment

by:ptmcomp
ID: 9625389
I think only a client can determinate when the server hangs.
Are you using TCP remoting?? This "hangers" are caused by an implementation failure. Use HTTP remoting with binary formatter and the problems should be gone...
0
 
LVL 5

Author Comment

by:jjacksn
ID: 9629094
The hangs are due to actual bugs in the server code.

I am using HTTP remoting with a binary formatter.  

Is there any easy way to determine if a connection exists?
0
 
LVL 10

Accepted Solution

by:
ptmcomp earned 1000 total points
ID: 9629523
>The hangs are due to actual bugs in the server code.
Due bugs in your or "Microsoft's .net framework" code? (We had such problems and thought to have it solved with the httpChannel...)

>Basically, is there an easy way to determine if the client has an interent connection up and running?
Yes, use any other service to check if the internet is available (e.g. DNS or http request on a very stable website. You can also use ping, or any other protocol.)

>is there a way to set a timeout on a remoting call?
As far I know: no. You can use a delegate with BeginInvoke / EndInvoke to call the method asynchronous.

>If a call to the server (via method call on the remoting object) throws an exception, is there a way to check whether this is due to the client not having an internet connection or the server being down?
Almost not possible :o(
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 5

Author Comment

by:jjacksn
ID: 9658933
ptm,

Thanks,

I'm a little confused how the workflow should go for determining server hangs.  I should call the method in a seperate thread, then have the thread that is not calling the procedue loop until the first thread is done or times out?
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 9812869
I had some similar problems today and I traced the network traffic. What kind of remoting objects did you use (client activated, singelton, single call)?
It seems that under certain circumstances the endpoint given back to the client which should be the server's ip is rubbish as 127.0.0.1 and then the client tries to connect to this endpoint what results in a stupid loop-back. The error message is that the remote client is not reachable but in fact they were communicating with each other to contruct the object on the server but then the server gave back a wrong object-endpoint/url.
0
 
LVL 5

Author Comment

by:jjacksn
ID: 9812913
We are using singletons.  

This ip is coming back as 127.0.0.1?  When is under what conditions is this happening?  When my network is disconnected, the timeout is quick.  However, when I turn the server off, and the client has an internet connection, it takes a long time to fail.  

When the client isn't sure if it has a valid internet connection (bad peer to peer network or something) it takes extremely long for the timeout to happen.
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 9813311
I think you should also try to make a SingleCall lightweight remoting facade for your singletons. You can still access standard singleton objects behind that facade. SingleCall doesn't use this endpoint stuff and might be not cause those errors. That's may be why Ingo Rammer is also telling to use SingleCall - but he's not telling why. May be he must not say that Microsoft did very bad work in implementing this Remoting endpoint stuff...
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 9813336
Another thing: In usual remoting calls with CAO (client activated objects) there is no new TCP connection opened and it's not closed in the end for both: TCP and HTTP remoting. I think they assume that an opened connection will stay forever open till explicitly closed. (WinInet has also problems with connections that are closed by timeout or cause of network problems.) It's like you call someone with your cellphone while driving a car and just trying to continue your conversation when the line is cut...
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 9813487
There are other channels available which say that they are more reliable:

http://www.genuinechannels.com/Content.aspx?id=17&type=1
http://www.ingorammer.com/Software/OpenSource.html
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 9830098
0
 
LVL 5

Author Comment

by:jjacksn
ID: 9843768
The root of the problem, is that the timeout just takes way to long when the server is unreachable.  Isn't there some way to specify the timeout delay?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question