When attempting to set the IpMulticastTtl channel option the provided value is ignored and instead the default value of 1 is retained.
var multicastHandler = new MulticastTestHandler();
var serverBootstrap = new Bootstrap();
serverBootstrap
.Group(serverGroup)
.ChannelFactory(() => new SocketDatagramChannel(addressFamily))
.Option(ChannelOption.IpMulticastTtl, 128)
.Handler(new ActionChannelInitializer<IChannel>(channel =>
{
channel.Pipeline.AddLast(nameof(SocketDatagramChannelMulticastTest), multicastHandler);
}));
Also, attempting to get the IpMulticastTtl channel option results in the following exception.
System.InvalidCastException: 'Unable to cast object of type 'System.Int32' to type 'System.Int16'.'
int multicast = serverChannel.Configuration.GetOption(ChannelOption.IpMulticastTtl);
IpMulticastTtl is declared as ChannelOption<int> and possibly should be declared as ChannelOption<short>?
When attempting to set the IpMulticastTtl channel option the provided value is ignored and instead the default value of 1 is retained.
Also, attempting to get the IpMulticastTtl channel option results in the following exception.
System.InvalidCastException: 'Unable to cast object of type 'System.Int32' to type 'System.Int16'.'
IpMulticastTtl is declared as
ChannelOption<int>
and possibly should be declared asChannelOption<short>
?