Skip to Content
Programming WCF Services, 3rd Edition
book

Programming WCF Services, 3rd Edition

by Juval Lowy
August 2010
Intermediate to advanced
908 pages
26h 22m
English
O'Reilly Media, Inc.
Content preview from Programming WCF Services, 3rd Edition

Address Discovery

Discovery relies on UDP (User Datagram Protocol). Unlike TCP, UDP is a connectionless protocol, and no direct connection is required between the packet’s sender and the receiver. The client uses UDP to broadcast discovery requests for any endpoint supporting a specified contract type. Dedicated UDP discovery endpoints that the services support will receive these requests (WCF offers a standard implementation of the discovery endpoint). The implementation of the discovery endpoint, in turn, responds back to the client with the address of the service endpoints that support the specified contract. Once the client discovers the services, it continues to invoke them as with regular WCF calls. This sequence is illustrated in Figure C-1.

Address discovery over UDP

Figure C-1. Address discovery over UDP

Note

Since discovery is predicated on the service responding to the client request, the service process must be running before the client issues the request. This mandates the use of self-hosting or Windows Server AppFabric with Auto-start enabled.

Service Configuration

To receive the discovery request, the service must support a discovery endpoint. Much like the MEX endpoint, WCF offers a standard discovery endpoint with the type UdpDiscoveryEndpoint:

public class DiscoveryEndpoint : ServiceEndpoint
{...}
public class UdpDiscoveryEndpoint : DiscoveryEndpoint
{...}

The service can have the host implement ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming WCF Services, 4th Edition

Programming WCF Services, 4th Edition

Juval Lowy, Michael Montgomery
Programming .NET Security

Programming .NET Security

Adam Freeman, Allen Jones

Publisher Resources

ISBN: 9781449382476Supplemental ContentErrata Page