Solved

what does a remoting method return if it timesout in .net2?

Posted on 2006-11-10
4
313 Views
Last Modified: 2010-04-16
if I have a method called getSomeData() that returns a string, then what will happen if the call timesout in .net 2 ?

example string s = myRemotingObject.getSomeData();

how do i control timeouts also or set their length?

please advice how to deal/handle timeouts
0
Comment
Question by:joshuadavidlee
[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
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 500 total points
ID: 17915626
It should throw a RemotingTimeoutException in that case.  You have to use a Try..Catch block to catch and handle that.

try {
    string s =  myRemotingObject.getSomeData();
    // At this point you know the data came back correctly, so use 's' with that assumption.

} catch (RemotingTimeoutException e) {
    // There was a timeout; do what you like to resolve it.
}
0
 

Author Comment

by:joshuadavidlee
ID: 17916247
ok can i set the timeout limit in .net 2 ?
0
 

Author Comment

by:joshuadavidlee
ID: 17916253
and does timeout mean the time for it to complete the method or doe si tmean nothing shappening?

for example what if it takes 5 minutes to transfer a file and i set it to timeout 30 seconds?
0
 
LVL 6

Expert Comment

by:badalpatel
ID: 17919867
There are two places you may have to change:

1. Change the ASP.NET timeout
http://www.devx.com/vb2themax/Tip/18803

This is the most likely culprit of your errors

2. Use the Timeout property of your proxy class to set the proper time on
the client.

WebReference.ProxyClass myProxy = new WebReference.ProxyClass();
// Set the timeout in milliseconds -- e.g. 100 seconds
myProxy.Timeout = 100000;

Hope that helps.
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Six Sigma Control Plans

717 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