Is this safe? Any pitfalls? I have done threading in regular C# apps,
but haven't had a needs to do threading in ASP.Net, until now.
The issue I have ran into is this: Our corporate portal application
displays the logged in users 10 most recent emails from Exchange via
WebDav. The current code is in legacy VB6 and needs to be ported
*really* bad. Exchange 2003 has an issue where it only allows a max of
256 WebDav connections from one account. We used one "master" account
to authenticate against Exchange that could read any users mailbox. We
have 1,000's of employees and we exceeded the 256 connection limit. So
we added another "master" user with read access and then a third and we
round-robin between those.
The main issue is that we are getting some exchange bug where if
exchange goes down or has an issue during a request, the WebDav code
blocks until the portal timeout occurs and no one can get into the
portal. Employees need to always be able to get into the portal, even
if email is down. The portal is the gateway to most corporate apps for
all the non-technical users. The portal is PeopleSoft Portal. The way
PeopleSoft creates the home page with all the "pagelets" is that the
PeopleSoft Portal goes and makes the requests for the pages in the
background like a proxy server. It then puts all the pieces together
and runs the HTML through HtmlTidy to "fix" the broken HTML (remove
multiple <head><body> etc). Not the best method, but I cannot change
that. So if one of the "pagelets" takes too long, the whole stinking
PeopleSoft portal home page times out and prevents login.
I need to change it so that users can get into the portal even if there
is a timeout. I already ported the code to C# to do all the WebDav. I
get the emails back fine. I set the timeout property on the
HttpWebRequest object to 5 seconds. However, I need to be certain that
the method will always return in 5 seconds or less so I do not want to
only rely on the timeout property of the HttpWebRequest object.
I was going to write a wrapper function that creates a new thread. That
function in the thread does all the WebDav stuff. If that thread hasn't
returned in 5 seconds, the wrapper function just calls abort and returns
an empty XML response.
Will I run in to any threading issues with threading under ASP.Net? Is
the timeout property of the HttpWebRequest object *dependable*? Or
should I do the threading approach?
Thanks for any feedback,
Jim
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
There's no place like 127.0.0.1
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
JimD
Central FL, USA, Earth, Sol