I would like to add callbacks to my WCF service, so that
my client can receive notifications of certain server events.
I found a beginner’s guide to callbacks: http://idunno.org/archive/2008/05/29/wcf-callbacks-a-beginners-guide.aspx, but this seems to only apply to HTTP binding.
Any ideas?
Actually, it doesn’t apply to a regular HTTP binding (which is one-way), only wsDualHttpBinding, which is a special binding not typically supported on platforms other than .NET. Using callbacks with NetTCP is as easy as changing
to
and
to
Just make sure whatever port you use isn’t already bound to by another process on your system, such as IIS (unless you plan to host your service inside IIS).