Class DefaultDatagramSessionConfig
java.lang.Object
org.apache.mina.core.session.AbstractIoSessionConfig
org.apache.mina.transport.socket.AbstractDatagramSessionConfig
org.apache.mina.transport.socket.DefaultDatagramSessionConfig
- All Implemented Interfaces:
IoSessionConfig, DatagramSessionConfig
A default implementation of
DatagramSessionConfig.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final booleanprivate static final intprivate static final booleanprivate static final intprivate static final intprivate intprivate booleanprivate intprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintbooleanprotected booleanprotected booleanbooleanprotected booleanprotected booleanprotected booleanvoidsetBroadcast(boolean broadcast) voidsetReceiveBufferSize(int receiveBufferSize) voidsetReuseAddress(boolean reuseAddress) voidsetSendBufferSize(int sendBufferSize) voidsetTrafficClass(int trafficClass) Methods inherited from class AbstractDatagramSessionConfig
isCloseOnPortUnreachable, setAll, setCloseOnPortUnreachableMethods inherited from class AbstractIoSessionConfig
getBothIdleTime, getBothIdleTimeInMillis, getIdleTime, getIdleTimeInMillis, getMaxReadBufferSize, getMinReadBufferSize, getReadBufferSize, getReaderIdleTime, getReaderIdleTimeInMillis, getThroughputCalculationInterval, getThroughputCalculationIntervalInMillis, getWriterIdleTime, getWriterIdleTimeInMillis, getWriteTimeout, getWriteTimeoutInMillis, isUseReadOperation, setBothIdleTime, setIdleTime, setMaxReadBufferSize, setMinReadBufferSize, setReadBufferSize, setReaderIdleTime, setThroughputCalculationInterval, setUseReadOperation, setWriterIdleTime, setWriteTimeoutMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IoSessionConfig
getBothIdleTime, getBothIdleTimeInMillis, getIdleTime, getIdleTimeInMillis, getMaxReadBufferSize, getMinReadBufferSize, getReadBufferSize, getReaderIdleTime, getReaderIdleTimeInMillis, getThroughputCalculationInterval, getThroughputCalculationIntervalInMillis, getWriterIdleTime, getWriterIdleTimeInMillis, getWriteTimeout, getWriteTimeoutInMillis, isUseReadOperation, setBothIdleTime, setIdleTime, setMaxReadBufferSize, setMinReadBufferSize, setReadBufferSize, setReaderIdleTime, setThroughputCalculationInterval, setUseReadOperation, setWriterIdleTime, setWriteTimeout
-
Field Details
-
DEFAULT_BROADCAST
private static final boolean DEFAULT_BROADCAST- See Also:
-
DEFAULT_REUSE_ADDRESS
private static final boolean DEFAULT_REUSE_ADDRESS- See Also:
-
DEFAULT_RECEIVE_BUFFER_SIZE
private static final int DEFAULT_RECEIVE_BUFFER_SIZE- See Also:
-
DEFAULT_SEND_BUFFER_SIZE
private static final int DEFAULT_SEND_BUFFER_SIZE- See Also:
-
DEFAULT_TRAFFIC_CLASS
private static final int DEFAULT_TRAFFIC_CLASS- See Also:
-
broadcast
private boolean broadcast -
reuseAddress
private boolean reuseAddress -
receiveBufferSize
private int receiveBufferSize -
sendBufferSize
private int sendBufferSize -
trafficClass
private int trafficClass
-
-
Constructor Details
-
DefaultDatagramSessionConfig
public DefaultDatagramSessionConfig()Creates a new instance.
-
-
Method Details
-
isBroadcast
public boolean isBroadcast()- Returns:
trueif SO_BROADCAST is enabled.- See Also:
-
setBroadcast
public void setBroadcast(boolean broadcast) - Parameters:
broadcast- Tells if SO_BROACAST is enabled or not- See Also:
-
isReuseAddress
public boolean isReuseAddress()- Returns:
trueif SO_REUSEADDR is enabled.- See Also:
-
setReuseAddress
public void setReuseAddress(boolean reuseAddress) - Parameters:
reuseAddress- Tells if SO_REUSEADDR is enabled or disabled- See Also:
-
getReceiveBufferSize
public int getReceiveBufferSize()- Returns:
- the size of the receive buffer
- See Also:
-
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize) - Parameters:
receiveBufferSize- The size of the receive buffer- See Also:
-
getSendBufferSize
public int getSendBufferSize()- Returns:
- the size of the send buffer
- See Also:
-
setSendBufferSize
public void setSendBufferSize(int sendBufferSize) - Parameters:
sendBufferSize- The size of the send buffer- See Also:
-
getTrafficClass
public int getTrafficClass()- Returns:
- the traffic class
- See Also:
-
setTrafficClass
public void setTrafficClass(int trafficClass) - Parameters:
trafficClass- The traffic class to set, one of IPTOS_LOWCOST (0x02) IPTOS_RELIABILITY (0x04), IPTOS_THROUGHPUT (0x08) or IPTOS_LOWDELAY (0x10)- See Also:
-
isBroadcastChanged
protected boolean isBroadcastChanged()- Overrides:
isBroadcastChangedin classAbstractDatagramSessionConfig- Returns:
trueif and only if thebroadcastproperty has been changed by its setter method. The system call related with the property is made only when this method returnstrue. By default, this method always returnstrueto simplify implementation of subclasses, but overriding the default behavior is always encouraged.
-
isReceiveBufferSizeChanged
protected boolean isReceiveBufferSizeChanged()- Overrides:
isReceiveBufferSizeChangedin classAbstractDatagramSessionConfig- Returns:
trueif and only if thereceiveBufferSizeproperty has been changed by its setter method. The system call related with the property is made only when this method returnstrue. By default, this method always returnstrueto simplify implementation of subclasses, but overriding the default behavior is always encouraged.
-
isReuseAddressChanged
protected boolean isReuseAddressChanged()- Overrides:
isReuseAddressChangedin classAbstractDatagramSessionConfig- Returns:
trueif and only if thereuseAddressproperty has been changed by its setter method. The system call related with the property is made only when this method returnstrue. By default, this method always returnstrueto simplify implementation of subclasses, but overriding the default behavior is always encouraged.
-
isSendBufferSizeChanged
protected boolean isSendBufferSizeChanged()- Overrides:
isSendBufferSizeChangedin classAbstractDatagramSessionConfig- Returns:
trueif and only if thesendBufferSizeproperty has been changed by its setter method. The system call related with the property is made only when this method returnstrue. By default, this method always returnstrueto simplify implementation of subclasses, but overriding the default behavior is always encouraged.
-
isTrafficClassChanged
protected boolean isTrafficClassChanged()- Overrides:
isTrafficClassChangedin classAbstractDatagramSessionConfig- Returns:
trueif and only if thetrafficClassproperty has been changed by its setter method. The system call related with the property is made only when this method returnstrue. By default, this method always returnstrueto simplify implementation of subclasses, but overriding the default behavior is always encouraged.
-