org.jboss.netty.channel.socket
Class DefaultSocketChannelConfig

java.lang.Object
  extended by org.jboss.netty.channel.DefaultChannelConfig
      extended by org.jboss.netty.channel.socket.DefaultSocketChannelConfig
All Implemented Interfaces:
ChannelConfig, SocketChannelConfig

public class DefaultSocketChannelConfig
extends DefaultChannelConfig
implements SocketChannelConfig

The default SocketChannelConfig implementation.

Version:
$Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
Author:
The Netty Project, Trustin Lee

Constructor Summary
DefaultSocketChannelConfig(Socket socket)
          Creates a new instance.
 
Method Summary
 int getReceiveBufferSize()
          Gets the SO_RCVBUF option.
 int getSendBufferSize()
          Gets the SO_SNDBUF option.
 int getSoLinger()
          Gets the SO_LINGER option.
 int getTrafficClass()
          Gets the traffic class.
 boolean isKeepAlive()
          Gets the SO_KEEPALIVE option.
 boolean isReuseAddress()
          Gets the SO_REUSEADDR option.
 boolean isTcpNoDelay()
          Gets the SO_TCPNODELAY option.
 void setKeepAlive(boolean keepAlive)
          Sets the SO_KEEPALIVE option.
 boolean setOption(String key, Object value)
          Sets a configuration property with the specified name and value.
 void setPerformancePreferences(int connectionTime, int latency, int bandwidth)
          Sets the performance preferences as specified in Socket.setPerformancePreferences(int, int, int).
 void setReceiveBufferSize(int receiveBufferSize)
          Gets the SO_RCVBUF option.
 void setReuseAddress(boolean reuseAddress)
          Sets the SO_REUSEADDR option.
 void setSendBufferSize(int sendBufferSize)
          Sets the SO_SNDBUF option.
 void setSoLinger(int soLinger)
          Sets the SO_LINGER option.
 void setTcpNoDelay(boolean tcpNoDelay)
          Sets the SO_TCPNODELAY option.
 void setTrafficClass(int trafficClass)
          Sets the traffic class as specified in Socket.setTrafficClass(int).
 
Methods inherited from class org.jboss.netty.channel.DefaultChannelConfig
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.netty.channel.ChannelConfig
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory
 

Constructor Detail

DefaultSocketChannelConfig

public DefaultSocketChannelConfig(Socket socket)
Creates a new instance.

Method Detail

setOption

public boolean setOption(String key,
                         Object value)
Description copied from interface: ChannelConfig
Sets a configuration property with the specified name and value. To override this method properly, you must call the super class:
 public boolean setOption(String name, Object value) {
     if (super.setOption(name, value)) {
         return true;
     }

     if (name.equals("additionalOption")) {
         ....
         return true;
     }

     return false;
 }
 

Specified by:
setOption in interface ChannelConfig
Overrides:
setOption in class DefaultChannelConfig
Returns:
true if and only if the property has been set

getReceiveBufferSize

public int getReceiveBufferSize()
Description copied from interface: SocketChannelConfig
Gets the SO_RCVBUF option.

Specified by:
getReceiveBufferSize in interface SocketChannelConfig

getSendBufferSize

public int getSendBufferSize()
Description copied from interface: SocketChannelConfig
Gets the SO_SNDBUF option.

Specified by:
getSendBufferSize in interface SocketChannelConfig

getSoLinger

public int getSoLinger()
Description copied from interface: SocketChannelConfig
Gets the SO_LINGER option.

Specified by:
getSoLinger in interface SocketChannelConfig

getTrafficClass

public int getTrafficClass()
Description copied from interface: SocketChannelConfig
Gets the traffic class.

Specified by:
getTrafficClass in interface SocketChannelConfig

isKeepAlive

public boolean isKeepAlive()
Description copied from interface: SocketChannelConfig
Gets the SO_KEEPALIVE option.

Specified by:
isKeepAlive in interface SocketChannelConfig

isReuseAddress

public boolean isReuseAddress()
Description copied from interface: SocketChannelConfig
Gets the SO_REUSEADDR option.

Specified by:
isReuseAddress in interface SocketChannelConfig

isTcpNoDelay

public boolean isTcpNoDelay()
Description copied from interface: SocketChannelConfig
Gets the SO_TCPNODELAY option.

Specified by:
isTcpNoDelay in interface SocketChannelConfig

setKeepAlive

public void setKeepAlive(boolean keepAlive)
Description copied from interface: SocketChannelConfig
Sets the SO_KEEPALIVE option.

Specified by:
setKeepAlive in interface SocketChannelConfig

setPerformancePreferences

public void setPerformancePreferences(int connectionTime,
                                      int latency,
                                      int bandwidth)
Description copied from interface: SocketChannelConfig
Sets the performance preferences as specified in Socket.setPerformancePreferences(int, int, int).

Specified by:
setPerformancePreferences in interface SocketChannelConfig

setReceiveBufferSize

public void setReceiveBufferSize(int receiveBufferSize)
Description copied from interface: SocketChannelConfig
Gets the SO_RCVBUF option.

Specified by:
setReceiveBufferSize in interface SocketChannelConfig

setReuseAddress

public void setReuseAddress(boolean reuseAddress)
Description copied from interface: SocketChannelConfig
Sets the SO_REUSEADDR option.

Specified by:
setReuseAddress in interface SocketChannelConfig

setSendBufferSize

public void setSendBufferSize(int sendBufferSize)
Description copied from interface: SocketChannelConfig
Sets the SO_SNDBUF option.

Specified by:
setSendBufferSize in interface SocketChannelConfig

setSoLinger

public void setSoLinger(int soLinger)
Description copied from interface: SocketChannelConfig
Sets the SO_LINGER option.

Specified by:
setSoLinger in interface SocketChannelConfig

setTcpNoDelay

public void setTcpNoDelay(boolean tcpNoDelay)
Description copied from interface: SocketChannelConfig
Sets the SO_TCPNODELAY option.

Specified by:
setTcpNoDelay in interface SocketChannelConfig

setTrafficClass

public void setTrafficClass(int trafficClass)
Description copied from interface: SocketChannelConfig
Sets the traffic class as specified in Socket.setTrafficClass(int).

Specified by:
setTrafficClass in interface SocketChannelConfig


Copyright © 2008-2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.