Ejemplo n.º 1
0
        public CreateEndpointSettings(IEndpointAddress address, CreateEndpointSettings source)
            : this()
        {
            Guard.Against.Null(address, "The address cannot be null");
            Guard.Against.Null(source, "The source settings cannot be null");

            Address = new EndpointAddress(address.Uri);
            SetDefaultErrorAddress();

            Serializer = source.Serializer;
        }
Ejemplo n.º 2
0
        public CreateEndpointSettings(IEndpointAddress address, CreateEndpointSettings source)
            : this()
        {
            Guard.Against.Null(address, "The address cannot be null");
            Guard.Against.Null(source, "The source settings cannot be null");

            Address = new EndpointAddress(address.Uri);
            SetDefaultErrorAddress();

            Serializer = source.Serializer;
        }
        public static IEndpoint New(CreateEndpointSettings settings)
        {
            try
            {
                Guard.Against.Null(settings.Address, "An address for the endpoint must be specified");
                Guard.Against.Null(settings.ErrorAddress, "An error address for the endpoint must be specified");
                Guard.Against.Null(settings.Serializer, "A message serializer for the endpoint must be specified");

                var transport = new MulticastUdpTransport(settings.Address);

                var errorTransport = new NullTransport(settings.ErrorAddress);

                var endpoint = new MulticastUdpEndpoint(settings.Address, settings.Serializer, transport, errorTransport);

                return endpoint;
            }
            catch (Exception ex)
            {
                throw new EndpointException(settings.Address.Uri, "Failed to create multicast endpoint", ex);
            }
        }
        public static IEndpoint New(CreateEndpointSettings settings)
        {
            try
            {
                Guard.Against.Null(settings.Address, "An address for the endpoint must be specified");
                Guard.Against.Null(settings.ErrorAddress, "An error address for the endpoint must be specified");
                Guard.Against.Null(settings.Serializer, "A message serializer for the endpoint must be specified");

                var transport = new MulticastUdpTransport(settings.Address);

                var errorTransport = new NullTransport(settings.ErrorAddress);

                var endpoint = new MulticastUdpEndpoint(settings.Address, settings.Serializer, transport, errorTransport);

                return(endpoint);
            }
            catch (Exception ex)
            {
                throw new EndpointException(settings.Address.Uri, "Failed to create multicast endpoint", ex);
            }
        }