/// <summary>
 /// Constructs a WCF based actor remoting listener.
 /// </summary>
 /// <param name="listenerBinding">WCF binding to use for the listener. If the listener binding is not specified or null,
 /// a default listener binding is created using <see cref="Microsoft.ServiceFabric.Services.Communication.Wcf.WcfUtility.CreateTcpListenerBinding"/> method which creates
 /// a <see cref="System.ServiceModel.NetTcpBinding"/> with no security.
 /// </param>
 /// <param name="actorService">The actor service.</param>
 public WcfActorServiceRemotingListener(
     ActorService actorService,
     Binding listenerBinding = null)
     : base(
         GetContext(actorService),
         new ActorServiceRemotingDispatcher(actorService),
         listenerBinding,
         ActorNameFormat.GetFabricServiceEndpointName(actorService.ActorTypeInformation.ImplementationType))
 {
 }
 /// <summary>
 /// Constructs a WCF based actor remoting listener.
 /// </summary>
 /// <param name="listenerBinding">WCF binding to use for the listener. If the listener binding is not specified or null,
 /// a default listener binding is created using <see cref="Microsoft.ServiceFabric.Services.Communication.Wcf.WcfUtility.CreateTcpListenerBinding"/> method which creates
 /// a <see cref="System.ServiceModel.NetTcpBinding"/> with no security.
 /// </param>
 /// <param name="actorService">The actor service.</param>
 public WcfActorServiceRemotingListener(
     ActorService actorService,
     Binding listenerBinding = null)
     : base(
         GetContext(actorService),
         new ActorServiceRemotingDispatcher(actorService, new DataContractRemotingMessageFactory()),
         new ActorRemotingSerializationManager(new BasicDataContractSerializationProvider(),
                                               new BasicDataContractActorHeaderSerializer()),
         listenerBinding,
         ActorNameFormat.GetFabricServiceEndpointName(actorService.ActorTypeInformation.ImplementationType))
 {
 }
        private static FabricTransportRemotingListenerSettings SetEndPointResourceName(
            FabricTransportRemotingListenerSettings listenerSettings, ActorService actorService)
        {
            if (listenerSettings == null)
            {
                listenerSettings = GetActorListenerSettings(actorService);
            }

            if (listenerSettings.EndpointResourceName.Equals(FabricTransportRemotingListenerSettings.DefaultEndpointResourceName))
            {
                listenerSettings.EndpointResourceName = ActorNameFormat.GetFabricServiceEndpointName(
                    actorService.ActorTypeInformation.ImplementationType);
            }
            return(listenerSettings);
        }