Closing a WCF connection asynchronously

N

Norm

Hello,

I have a web page that is getting some data from a WCF webservice. I
have it operating pretty nicely. The connection open is running
asynchronous and it all works. I noticed that the IClientChannel
interface also has a Begin/End close method. My question is: can I
just call BeginClose and trash the IAsyncResult? Will it fail to close
completely when it disposes? Its not really a big deal, I'm just
curious.

Norm
 
N

Norm

Nevermind.

I'll just call close during Page.Unload which wont block the page
being rendered to the client. Much easier.

Norm
 
B

bruce barker

this is a really, really bad programing practice. you should not be
calling async routines from an aspx page except via the
AddOnPreRenderCompleteAsync method. this is the only supported method.

as long as there is no load on you site you can get away with what you
are doing, but any load and you will start having problems.

-- bruce (sqlwork.com)
 
N

Norm

this is a really, really bad programing practice. you should not be
calling async routines from an aspx page except via the
AddOnPreRenderCompleteAsync method. this is the only supported method.

as long as there is no load on you site you can get away with what you
are doing, but any load and you will start having problems.

-- bruce (sqlwork.com)

Hi Bruce,
I never checked this thread after my second post and I just saw it
now. What is the problem with calling async routines in aspx pages
outside of the AddOnPreRenderCompleteAsync method? What about the
RegisterAsyncTask method? Why would the async methods cause problems
under load? I would appreciate any information you can give me, and if
you have some links to a few whitepapers or something that would be
awesome. I am always striving to not succumb to "really, really bad
programing practice". Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top