コード例 #1
0
        public static TChannel CreateChannel(InstanceContext callbackInstance, Binding binding, EndpointAddress endpointAddress, Uri via)
        {
            TChannel channel = new DuplexChannelFactory <TChannel>(callbackInstance, binding).CreateChannel(endpointAddress, via);

            ChannelFactory <TChannel> .SetFactoryToAutoClose(channel);

            return(channel);
        }
コード例 #2
0
        public static TChannel CreateChannel(InstanceContext callbackInstance, string endpointConfigurationName)
        {
            TChannel channel = new DuplexChannelFactory <TChannel>(callbackInstance, endpointConfigurationName).CreateChannel();

            ChannelFactory <TChannel> .SetFactoryToAutoClose(channel);

            return(channel);
        }
コード例 #3
0
        public static TChannel CreateChannel(Binding binding, EndpointAddress endpointAddress, Uri via)
        {
            ChannelFactory <TChannel> factory = new ChannelFactory <TChannel>(binding);

            if (factory.HasDuplexOperations())
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxInvalidStaticOverloadCalledForDuplexChannelFactory1", new object[] { factory.channelType.Name })));
            }
            TChannel channel = factory.CreateChannel(endpointAddress, via);

            ChannelFactory <TChannel> .SetFactoryToAutoClose(channel);

            return(channel);
        }
コード例 #4
0
        protected static TChannel CreateChannel(string endpointConfigurationName)
        {
            ChannelFactory <TChannel> factory = new ChannelFactory <TChannel>(endpointConfigurationName);

            if (factory.HasDuplexOperations())
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxInvalidStaticOverloadCalledForDuplexChannelFactory1", new object[] { factory.channelType.Name })));
            }
            TChannel channel = factory.CreateChannel();

            ChannelFactory <TChannel> .SetFactoryToAutoClose(channel);

            return(channel);
        }