org.jboss.netty.channel.socket
接口 DatagramChannelConfig

所有超级接口:
ChannelConfig
所有已知子接口:
NioDatagramChannelConfig
所有已知实现类:
DefaultDatagramChannelConfig

public interface DatagramChannelConfig
extends ChannelConfig

DatagramChannelChannelConfig.

有效属性

ChannelConfig还提供其他的属性,DatagramChannelConfig有以下属性:
名称 关联setter方法
"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)


方法摘要
 java.net.InetAddress getInterface()
          获取多播数据包的网络接口地址.
 java.net.NetworkInterface getNetworkInterface()
          获取DatagramChannel发送的外发多播数据包的网络接口.
 int getReceiveBufferSize()
          返回 SO_RCVBUF 属性.
 ReceiveBufferSizePredictor getReceiveBufferSizePredictor()
          返回预测套接字接收缓冲可读字节的ReceiveBufferSizePredictor.默认预测机是 FixedReceiveBufferSizePredictor(768).
 ReceiveBufferSizePredictorFactory getReceiveBufferSizePredictorFactory()
          返回当新channel被创建并且ReceiveBufferSizePredictor没有设置时用于创建 ReceiveBufferSizePredictorReceiveBufferSizePredictorFactory.If no predictor was set for the channel, setReceiveBufferSizePredictor(ReceiveBufferSizePredictor) will be called with the new predictor.
 int getSendBufferSize()
          返回 SO_SNDBUF 属性.
 int getTimeToLive()
          获取发送到DatagramChannel的多播数据包的默认生存时间.
 int getTrafficClass()
          返回traffic类.
 boolean isBroadcast()
          返回 SO_BROADCAST 属性.
 boolean isLoopbackModeDisabled()
          判断是否为多播数据报设置了本地回路.
 boolean isReuseAddress()
          返回 SO_REUSEADDR 属性.
 void setBroadcast(boolean broadcast)
          设置 SO_BROADCAST 属性.
 void setInterface(java.net.InetAddress interfaceAddress)
          设置多播数据包使用的网络接口地址.
 void setLoopbackModeDisabled(boolean loopbackModeDisabled)
          设置多播数据报的本地回路.
 void setNetworkInterface(java.net.NetworkInterface networkInterface)
          设置DatagramChannel发送的外发多播数据包的网络接口.
 void setReceiveBufferSize(int receiveBufferSize)
          返回 SO_RCVBUF 属性.
 void setReceiveBufferSizePredictor(ReceiveBufferSizePredictor predictor)
          设置预测套接字接收缓冲可读字节的ReceiveBufferSizePredictor.
 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)
          设置 SO_REUSEADDR 属性.
 void setSendBufferSize(int sendBufferSize)
          设置 SO_SNDBUF 属性.
 void setTimeToLive(int ttl)
          设置DatagramChannel发送出去的多播数据包的默认生存时间,以便控制多播的范围.
 void setTrafficClass(int trafficClass)
          如DatagramSocket.setTrafficClass(int)一样设置traffic类.
 
从接口 org.jboss.netty.channel.ChannelConfig 继承的方法
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOption, setOptions, setPipelineFactory
 

方法详细信息

getSendBufferSize

int getSendBufferSize()
返回 SO_SNDBUF 属性.


setSendBufferSize

void setSendBufferSize(int sendBufferSize)
设置 SO_SNDBUF 属性.


getReceiveBufferSize

int getReceiveBufferSize()
返回 SO_RCVBUF 属性.


setReceiveBufferSize

void setReceiveBufferSize(int receiveBufferSize)
返回 SO_RCVBUF 属性.


getTrafficClass

int getTrafficClass()
返回traffic类.


setTrafficClass

void setTrafficClass(int trafficClass)
DatagramSocket.setTrafficClass(int)一样设置traffic类.


isReuseAddress

boolean isReuseAddress()
返回 SO_REUSEADDR 属性.


setReuseAddress

void setReuseAddress(boolean reuseAddress)
设置 SO_REUSEADDR 属性.


isBroadcast

boolean isBroadcast()
返回 SO_BROADCAST 属性.


setBroadcast

void setBroadcast(boolean broadcast)
设置 SO_BROADCAST 属性.


isLoopbackModeDisabled

boolean isLoopbackModeDisabled()
判断是否为多播数据报设置了本地回路.

返回:
只有禁止了回路才返回true

setLoopbackModeDisabled

void setLoopbackModeDisabled(boolean loopbackModeDisabled)
设置多播数据报的本地回路.

参数:
loopbackModeDisabled - true为禁止回路

getTimeToLive

int getTimeToLive()
获取发送到DatagramChannel的多播数据包的默认生存时间.


setTimeToLive

void setTimeToLive(int ttl)
设置DatagramChannel发送出去的多播数据包的默认生存时间,以便控制多播的范围.


getInterface

java.net.InetAddress getInterface()
获取多播数据包的网络接口地址.


setInterface

void setInterface(java.net.InetAddress interfaceAddress)
设置多播数据包使用的网络接口地址.


getNetworkInterface

java.net.NetworkInterface getNetworkInterface()
获取DatagramChannel发送的外发多播数据包的网络接口.


setNetworkInterface

void setNetworkInterface(java.net.NetworkInterface networkInterface)
设置DatagramChannel发送的外发多播数据包的网络接口.


getReceiveBufferSizePredictor

ReceiveBufferSizePredictor getReceiveBufferSizePredictor()
返回预测套接字接收缓冲可读字节的ReceiveBufferSizePredictor.默认预测机是 FixedReceiveBufferSizePredictor(768).


setReceiveBufferSizePredictor

void setReceiveBufferSizePredictor(ReceiveBufferSizePredictor predictor)
设置预测套接字接收缓冲可读字节的ReceiveBufferSizePredictor. 默认预测机是 FixedReceiveBufferSizePredictor(768).


getReceiveBufferSizePredictorFactory

ReceiveBufferSizePredictorFactory getReceiveBufferSizePredictorFactory()
返回当新channel被创建并且ReceiveBufferSizePredictor没有设置时用于创建 ReceiveBufferSizePredictorReceiveBufferSizePredictorFactory.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).