[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 644
  • Last Modified:

Determining Failure on .NET Remoting question

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
jjacksn
Asked:
jjacksn
  • 7
  • 4
1 Solution
 
ptmcompCommented:
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
 
jjacksnAuthor Commented:
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
 
ptmcompCommented:
>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.

 
jjacksnAuthor Commented:
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
 
ptmcompCommented:
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
 
jjacksnAuthor Commented:
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
 
ptmcompCommented:
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
 
ptmcompCommented:
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
 
ptmcompCommented:
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
 
jjacksnAuthor Commented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now