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); } }