org.jboss.netty.channel.socket

## Class DefaultSocketChannelConfig

- java.lang.Object
- - org.jboss.netty.channel.DefaultChannelConfig
  - - org.jboss.netty.channel.socket.DefaultSocketChannelConfig

All Implemented Interfaces:
  ChannelConfig, SocketChannelConfig

    public class DefaultSocketChannelConfig
    extends DefaultChannelConfig
    implements SocketChannelConfig

The default `SocketChannelConfig` implementation.

### Constructor Summary

Constructors
Constructor and Description
`DefaultSocketChannelConfig(Socket socket)` Creates a new instance.

### Method Summary

Methods
`int` `getReceiveBufferSize()` Gets the `StandardSocketOptions.SO_RCVBUF` option.
`int` `getSendBufferSize()` Gets the `StandardSocketOptions.SO_SNDBUF` option.
`int` `getSoLinger()` Gets the `StandardSocketOptions.SO_LINGER` option.
`int` `getTrafficClass()` Gets the `StandardSocketOptions.IP_TOS` option.
`boolean` `isKeepAlive()` Gets the `StandardSocketOptions.SO_KEEPALIVE` option.
`boolean` `isReuseAddress()` Gets the `StandardSocketOptions.SO_REUSEADDR` option.
`boolean` `isTcpNoDelay()` Gets the `StandardSocketOptions.TCP_NODELAY` option.
`void` `setKeepAlive(boolean keepAlive)` Sets the `StandardSocketOptions.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)` Sets the `StandardSocketOptions.SO_RCVBUF` option.
`void` `setReuseAddress(boolean reuseAddress)` Sets the `StandardSocketOptions.SO_REUSEADDR` option.
`void` `setSendBufferSize(int sendBufferSize)` Sets the `StandardSocketOptions.SO_SNDBUF` option.
`void` `setSoLinger(int soLinger)` Sets the `StandardSocketOptions.SO_LINGER` option.
`void` `setTcpNoDelay(boolean tcpNoDelay)` Sets the `StandardSocketOptions.TCP_NODELAY` option.
`void` `setTrafficClass(int trafficClass)` Sets the `StandardSocketOptions.IP_TOS` option.

### 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 `StandardSocketOptions.SO_RCVBUF` option.

Specified by:
  `getReceiveBufferSize` in interface `SocketChannelConfig`

#### getSendBufferSize

    public int getSendBufferSize()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.SO_SNDBUF` option.

Specified by:
  `getSendBufferSize` in interface `SocketChannelConfig`

#### getSoLinger

    public int getSoLinger()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.SO_LINGER` option.

Specified by:
  `getSoLinger` in interface `SocketChannelConfig`

#### getTrafficClass

    public int getTrafficClass()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.IP_TOS` option.

Specified by:
  `getTrafficClass` in interface `SocketChannelConfig`

#### isKeepAlive

    public boolean isKeepAlive()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.SO_KEEPALIVE` option.

Specified by:
  `isKeepAlive` in interface `SocketChannelConfig`

#### isReuseAddress

    public boolean isReuseAddress()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.SO_REUSEADDR` option.

Specified by:
  `isReuseAddress` in interface `SocketChannelConfig`

#### isTcpNoDelay

    public boolean isTcpNoDelay()

Description copied from interface: `SocketChannelConfig`
Gets the `StandardSocketOptions.TCP_NODELAY` option.

Specified by:
  `isTcpNoDelay` in interface `SocketChannelConfig`

#### setKeepAlive

    public void setKeepAlive(boolean keepAlive)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.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`
Sets the `StandardSocketOptions.SO_RCVBUF` option.

Specified by:
  `setReceiveBufferSize` in interface `SocketChannelConfig`

#### setReuseAddress

    public void setReuseAddress(boolean reuseAddress)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.SO_REUSEADDR` option.

Specified by:
  `setReuseAddress` in interface `SocketChannelConfig`

#### setSendBufferSize

    public void setSendBufferSize(int sendBufferSize)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.SO_SNDBUF` option.

Specified by:
  `setSendBufferSize` in interface `SocketChannelConfig`

#### setSoLinger

    public void setSoLinger(int soLinger)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.SO_LINGER` option.

Specified by:
  `setSoLinger` in interface `SocketChannelConfig`

#### setTcpNoDelay

    public void setTcpNoDelay(boolean tcpNoDelay)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.TCP_NODELAY` option.

Specified by:
  `setTcpNoDelay` in interface `SocketChannelConfig`

#### setTrafficClass

    public void setTrafficClass(int trafficClass)

Description copied from interface: `SocketChannelConfig`
Sets the `StandardSocketOptions.IP_TOS` option.

Specified by:
  `setTrafficClass` in interface `SocketChannelConfig`