Easier example for ChannelConfig downcasting

This commit is contained in:
Trustin Lee 2008-09-03 01:30:17 +00:00
parent b88674e437
commit a73cdb1a4a

View File

@ -25,19 +25,19 @@ package org.jboss.netty.channel;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
import org.jboss.netty.channel.socket.nio.NioSocketChannelConfig; import org.jboss.netty.channel.socket.SocketChannelConfig;
/** /**
* A set of configuration properties of a {@link Channel}. * A set of configuration properties of a {@link Channel}.
* <p> * <p>
* Please down-cast to the transport-specific configuration type such as * Please down-cast to more specific configuration type such as
* {@link NioSocketChannelConfig} or use {@link #setOptions(Map)} to set the * {@link SocketChannelConfig} or use {@link #setOptions(Map)} to set the
* transport-specific properties: * transport-specific properties:
* <pre> * <pre>
* Channel ch = ...; * Channel ch = ...;
* NioSocketChannelConfig cfg = <strong>(NioSocketChannelConfig) ch.getConfig();</strong> * SocketChannelConfig cfg = <strong>(SocketChannelConfig) ch.getConfig();</strong>
* cfg.setWriteSpinCount(4); * cfg.setTcpNoDelay(false);
* </pre> * </pre>
* *
* @author The Netty Project (netty-dev@lists.jboss.org) * @author The Netty Project (netty-dev@lists.jboss.org)