Fixed ClassCastException in setting min,max sctp streams

This commit is contained in:
Jestan Nirojan 2013-07-06 17:23:20 +05:30 committed by Norman Maurer
parent 7bedd8f28e
commit 276d619afb

View File

@ -26,6 +26,7 @@ import io.netty.channel.RecvByteBufAllocator;
import io.netty.util.internal.PlatformDependent; import io.netty.util.internal.PlatformDependent;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import java.util.Map; import java.util.Map;
import static io.netty.channel.sctp.SctpChannelOption.*; import static io.netty.channel.sctp.SctpChannelOption.*;
@ -87,7 +88,8 @@ public class DefaultSctpChannelConfig extends DefaultChannelConfig implements Sc
} else if (option == SCTP_NODELAY) { } else if (option == SCTP_NODELAY) {
setSctpNoDelay((Boolean) value); setSctpNoDelay((Boolean) value);
} else if (option == SCTP_INIT_MAXSTREAMS) { } else if (option == SCTP_INIT_MAXSTREAMS) {
setInitMaxStreams((SctpStandardSocketOptions.InitMaxStreams) value); List<Integer> minMax = (List<Integer>) value;
setInitMaxStreams(SctpStandardSocketOptions.InitMaxStreams.create(minMax.get(0), minMax.get(1)));
} else { } else {
return super.setOption(option, value); return super.setOption(option, value);
} }