## org.jboss.netty.channel.socket
Interface DatagramChannelConfig

All Superinterfaces:
  ChannelConfig

All Known Subinterfaces:
  NioDatagramChannelConfig

All Known Implementing Classes:
  DefaultDatagramChannelConfig

    public interface DatagramChannelConfig

extends ChannelConfig

A `ChannelConfig` for a `DatagramChannel`.

### Available options

In addition to the options provided by `ChannelConfig`, `DatagramChannelConfig` allows the following options in the option map:

Name | Associated setter method
--- | ---
`"broadcast"` | `setBroadcast(boolean)`
`"interface"` | `setInterface(InetAddress)`
`"loopbackModeDisabled"` | `setLoopbackModeDisabled(boolean)`
`"networkInterface"` | `setNetworkInterface(NetworkInterface)`
`"reuseAddress"` | `setReuseAddress(boolean)`
`"receiveBufferSize"` | `setReceiveBufferSize(int)`
`"receiveBufferSizePredictor"` | `setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)`
`"receiveBufferSizePredictorFactory"` | `setReceiveBufferSizePredictorFactory(ReceiveBufferSizePredictorFactory)`
`"sendBufferSize"` | `setSendBufferSize(int)`
`"timeToLive"` | `setTimeToLive(int)`
`"trafficClass"` | `setTrafficClass(int)`

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

Method Summary
`InetAddress` `getInterface()` Gets the address of the network interface used for multicast packets.
`NetworkInterface` `getNetworkInterface()` Gets the network interface for outgoing multicast datagrams sent on the `DatagramChannel`.
`int` `getReceiveBufferSize()` Gets the `SO_RCVBUF` option.
`ReceiveBufferSizePredictor` `getReceiveBufferSizePredictor()` Returns the `ReceiveBufferSizePredictor` which predicts the number of readable bytes in the socket receive buffer.
`ReceiveBufferSizePredictorFactory` `getReceiveBufferSizePredictorFactory()` Returns the `ReceiveBufferSizePredictorFactory` which creates a new `ReceiveBufferSizePredictor` when a new channel is created and no `ReceiveBufferSizePredictor` was set.
`int` `getSendBufferSize()` Gets the `SO_SNDBUF` option.
`int` `getTimeToLive()` Gets the default time-to-live for multicast packets sent out on the socket.
`int` `getTrafficClass()` Gets the traffic class.
`boolean` `isBroadcast()` Gets the `SO_BROADCAST` option.
`boolean` `isLoopbackModeDisabled()` Gets the setting for local loopback of multicast datagrams.
`boolean` `isReuseAddress()` Gets the `SO_REUSEADDR` option.
`void` `setBroadcast(boolean broadcast)` Sets the `SO_BROADCAST` option.
`void` `setInterface(InetAddress interfaceAddress)` Sets the address of the network interface used for multicast packets.
`void` `setLoopbackModeDisabled(boolean loopbackModeDisabled)` Sets the setting for local loopback of multicast datagrams.
`void` `setNetworkInterface(NetworkInterface networkInterface)` Sets the network interface for outgoing multicast datagrams sent on the `DatagramChannel`.
`void` `setReceiveBufferSize(int receiveBufferSize)` Gets the `SO_RCVBUF` option.
`void` `setReceiveBufferSizePredictor(ReceiveBufferSizePredictor predictor)` Sets the `ReceiveBufferSizePredictor` which predicts the number of readable bytes in the socket receive buffer.
`void` `setReceiveBufferSizePredictorFactory(ReceiveBufferSizePredictorFactory predictorFactory)` Sets the `ReceiveBufferSizePredictor` which creates a new `ReceiveBufferSizePredictor` when a new channel is created and no `ReceiveBufferSizePredictor` was set.
`void` `setReuseAddress(boolean reuseAddress)` Sets the `SO_REUSEADDR` option.
`void` `setSendBufferSize(int sendBufferSize)` Sets the `SO_SNDBUF` option.
`void` `setTimeToLive(int ttl)` Sets the default time-to-live for multicast packets sent out on the `DatagramChannel` in order to control the scope of the multicasts.
`void` `setTrafficClass(int trafficClass)` Sets the traffic class as specified in `DatagramSocket.setTrafficClass(int)`.

Methods inherited from interface org.jboss.netty.channel.ChannelConfig
`getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOption, setOptions, setPipelineFactory`

Method Detail

### getSendBufferSize

    int getSendBufferSize()

  Gets the `SO_SNDBUF` option.

### setSendBufferSize

    void setSendBufferSize(int sendBufferSize)

  Sets the `SO_SNDBUF` option.

### getReceiveBufferSize

    int getReceiveBufferSize()

  Gets the `SO_RCVBUF` option.

### setReceiveBufferSize

    void setReceiveBufferSize(int receiveBufferSize)

  Gets the `SO_RCVBUF` option.

### getTrafficClass

    int getTrafficClass()

  Gets the traffic class.

### setTrafficClass

    void setTrafficClass(int trafficClass)

  Sets the traffic class as specified in `DatagramSocket.setTrafficClass(int)`.

### isReuseAddress

    boolean isReuseAddress()

  Gets the `SO_REUSEADDR` option.

### setReuseAddress

    void setReuseAddress(boolean reuseAddress)

  Sets the `SO_REUSEADDR` option.

### isBroadcast

    boolean isBroadcast()

  Gets the `SO_BROADCAST` option.

### setBroadcast

    void setBroadcast(boolean broadcast)

  Sets the `SO_BROADCAST` option.

### isLoopbackModeDisabled

    boolean isLoopbackModeDisabled()

  Gets the setting for local loopback of multicast datagrams.

  Returns:
    `true` if and only if the loopback mode has been disabled

### setLoopbackModeDisabled

    void setLoopbackModeDisabled(boolean loopbackModeDisabled)

  Sets the setting for local loopback of multicast datagrams.

  Parameters:
    `loopbackModeDisabled` - `true` if and only if the loopback mode has been disabled

### getTimeToLive

    int getTimeToLive()

  Gets the default time-to-live for multicast packets sent out on the socket.

### setTimeToLive

    void setTimeToLive(int ttl)

  Sets the default time-to-live for multicast packets sent out on the `DatagramChannel` in order to control the scope of the multicasts.

### getInterface

    InetAddress getInterface()

  Gets the address of the network interface used for multicast packets.

### setInterface

    void setInterface(InetAddress interfaceAddress)

  Sets the address of the network interface used for multicast packets.

### getNetworkInterface

    NetworkInterface getNetworkInterface()

  Gets the network interface for outgoing multicast datagrams sent on the `DatagramChannel`.

### setNetworkInterface

    void setNetworkInterface(NetworkInterface networkInterface)

  Sets the network interface for outgoing multicast datagrams sent on the `DatagramChannel`.

### getReceiveBufferSizePredictor

    ReceiveBufferSizePredictor getReceiveBufferSizePredictor()

  Returns the `ReceiveBufferSizePredictor` which predicts the number of readable bytes in the socket receive buffer. The default predictor is ``FixedReceiveBufferSizePredictor`(768)`.

### setReceiveBufferSizePredictor

    void setReceiveBufferSizePredictor(ReceiveBufferSizePredictor predictor)

  Sets the `ReceiveBufferSizePredictor` which predicts the number of readable bytes in the socket receive buffer. The default predictor is ``FixedReceiveBufferSizePredictor`(768)`.

### getReceiveBufferSizePredictorFactory

    ReceiveBufferSizePredictorFactory getReceiveBufferSizePredictorFactory()

  Returns the `ReceiveBufferSizePredictorFactory` which creates a new `ReceiveBufferSizePredictor` when a new channel is created and no `ReceiveBufferSizePredictor` was set. If no predictor was set for the channel, `setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)` will be called with the new predictor. The default factory is ``FixedReceiveBufferSizePredictorFactory`(768)`.

### setReceiveBufferSizePredictorFactory

    void setReceiveBufferSizePredictorFactory(ReceiveBufferSizePredictorFactory predictorFactory)

  Sets the `ReceiveBufferSizePredictor` which creates a new `ReceiveBufferSizePredictor` when a new channel is created and no `ReceiveBufferSizePredictor` was set. If no predictor was set for the channel, `setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)` will be called with the new predictor. The default factory is ``FixedReceiveBufferSizePredictorFactory`(768)`.

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