public class DefaultDatagramChannelConfig extends DefaultChannelConfig implements DatagramChannelConfig
DatagramChannelConfig
implementation.Constructor and Description |
---|
DefaultDatagramChannelConfig(DatagramSocket socket)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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 . |
boolean |
setOption(String key,
Object value)
Sets a configuration property with the specified name and value.
|
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) . |
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBufferFactory, getConnectTimeoutMillis, getPipelineFactory, setBufferFactory, setConnectTimeoutMillis, setOptions, setPipelineFactory
public DefaultDatagramChannelConfig(DatagramSocket socket)
public boolean setOption(String key, Object value)
ChannelConfig
public boolean setOption(String name, Object value) { if (super.setOption(name, value)) { return true; } if (name.equals("additionalOption")) { .... return true; } return false; }
setOption
in interface ChannelConfig
setOption
in class DefaultChannelConfig
true
if and only if the property has been setpublic boolean isBroadcast()
DatagramChannelConfig
SO_BROADCAST
option.isBroadcast
in interface DatagramChannelConfig
public void setBroadcast(boolean broadcast)
DatagramChannelConfig
SO_BROADCAST
option.setBroadcast
in interface DatagramChannelConfig
public InetAddress getInterface()
DatagramChannelConfig
getInterface
in interface DatagramChannelConfig
public void setInterface(InetAddress interfaceAddress)
DatagramChannelConfig
setInterface
in interface DatagramChannelConfig
public boolean isLoopbackModeDisabled()
DatagramChannelConfig
isLoopbackModeDisabled
in interface DatagramChannelConfig
true
if and only if the loopback mode has been disabledpublic void setLoopbackModeDisabled(boolean loopbackModeDisabled)
DatagramChannelConfig
setLoopbackModeDisabled
in interface DatagramChannelConfig
loopbackModeDisabled
- true
if and only if the loopback mode has been disabledpublic NetworkInterface getNetworkInterface()
DatagramChannelConfig
DatagramChannel
.getNetworkInterface
in interface DatagramChannelConfig
public void setNetworkInterface(NetworkInterface networkInterface)
DatagramChannelConfig
DatagramChannel
.setNetworkInterface
in interface DatagramChannelConfig
public boolean isReuseAddress()
DatagramChannelConfig
SO_REUSEADDR
option.isReuseAddress
in interface DatagramChannelConfig
public void setReuseAddress(boolean reuseAddress)
DatagramChannelConfig
SO_REUSEADDR
option.setReuseAddress
in interface DatagramChannelConfig
public int getReceiveBufferSize()
DatagramChannelConfig
SO_RCVBUF
option.getReceiveBufferSize
in interface DatagramChannelConfig
public void setReceiveBufferSize(int receiveBufferSize)
DatagramChannelConfig
SO_RCVBUF
option.setReceiveBufferSize
in interface DatagramChannelConfig
public int getSendBufferSize()
DatagramChannelConfig
SO_SNDBUF
option.getSendBufferSize
in interface DatagramChannelConfig
public void setSendBufferSize(int sendBufferSize)
DatagramChannelConfig
SO_SNDBUF
option.setSendBufferSize
in interface DatagramChannelConfig
public int getTimeToLive()
DatagramChannelConfig
getTimeToLive
in interface DatagramChannelConfig
public void setTimeToLive(int ttl)
DatagramChannelConfig
DatagramChannel
in order to control the scope of the multicasts.setTimeToLive
in interface DatagramChannelConfig
public int getTrafficClass()
DatagramChannelConfig
getTrafficClass
in interface DatagramChannelConfig
public void setTrafficClass(int trafficClass)
DatagramChannelConfig
DatagramSocket.setTrafficClass(int)
.setTrafficClass
in interface DatagramChannelConfig
public ReceiveBufferSizePredictor getReceiveBufferSizePredictor()
DatagramChannelConfig
ReceiveBufferSizePredictor
which predicts the
number of readable bytes in the socket receive buffer. The default
predictor is FixedReceiveBufferSizePredictor
(768).getReceiveBufferSizePredictor
in interface DatagramChannelConfig
public void setReceiveBufferSizePredictor(ReceiveBufferSizePredictor predictor)
DatagramChannelConfig
ReceiveBufferSizePredictor
which predicts the
number of readable bytes in the socket receive buffer. The default
predictor is FixedReceiveBufferSizePredictor
(768).setReceiveBufferSizePredictor
in interface DatagramChannelConfig
public ReceiveBufferSizePredictorFactory getReceiveBufferSizePredictorFactory()
DatagramChannelConfig
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, DatagramChannelConfig.setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)
will be called with the new predictor. The default factory is
FixedReceiveBufferSizePredictorFactory
(768).getReceiveBufferSizePredictorFactory
in interface DatagramChannelConfig
public void setReceiveBufferSizePredictorFactory(ReceiveBufferSizePredictorFactory predictorFactory)
DatagramChannelConfig
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, DatagramChannelConfig.setReceiveBufferSizePredictor(ReceiveBufferSizePredictor)
will be called with the new predictor. The default factory is
FixedReceiveBufferSizePredictorFactory
(768).setReceiveBufferSizePredictorFactory
in interface DatagramChannelConfig
Copyright © 2008-2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.