Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
- {
- return new[]
- {
- // Standard WCF Listener
- new ServiceInstanceListener(context =>
- new WcfCommunicationListener<IFooService>(
- wcfServiceObject: this,
- serviceContext: context,
- endpointResourceName: "WcfServiceEndpoint",
- listenerBinding: WcfUtility.CreateTcpListenerBinding()
- )
- ),
- // Service Bus Relay Listener
- new ServiceInstanceListener(context =>
- {
- var wcfRelay = new WcfCommunicationListener<IFooService>(
- wcfServiceObject: this,
- serviceContext: context);
- wcfRelay.ServiceHost.AddServiceEndpoint(
- typeof(IFooService),
- new NetTcpRelayBinding(),
- ServiceBusEnvironment.CreateServiceUri(
- "sb",
- "{mynamespace}.servicebus.windows.net",
- "{myservce}"))
- .Behaviors.Add(new TransportClientEndpointBehavior
- {
- TokenProvider =
- TokenProvider.CreateSharedAccessSignatureTokenProvider(
- "RootManageSharedAccessKey",
- "{mykey}")
- });
- return wcfRelay;
- })
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement