asynchronous web method calls - begin without end

G

groups.kellyg

If I have a web method called Log() and on the client I call
BeginLog() with a null value for the AsyncCallback, will this cause a
problem? I want to periodically Log messages to a Log web service but
I don't need any return value. Is it poor programming practice to do
it this way? Or is there a more preferred way?

gkelly
 
P

Peter Bromberg [C# MVP]

Probably a better approach would be to use the "fire-and-forget" pattern to
make a call to the synchronous webmethod so you don't need to wait for the
method to return, rather than trying to "abuse" the asynchronous version.

Search on "C# Fire and forget" and you'll find several examples including a
couple of my own.
Peter
 

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

Top