org.apache.mina.transport.tcp

## Class DefaultTcpSessionConfig

- java.lang.Object
- - org.apache.mina.session.AbstractIoSessionConfig
  - - org.apache.mina.transport.tcp.DefaultTcpSessionConfig

All Implemented Interfaces:
  IoSessionConfig, TcpSessionConfig

    public class DefaultTcpSessionConfig
    extends AbstractIoSessionConfig
    implements TcpSessionConfig

Implementation for the socket session configuration. Will hold the values for the service in change of configuring this session (before the session opening).

Author:
  Apache MINA Project

### Constructor Summary

Constructors
Constructor and Description
`DefaultTcpSessionConfig()`

### Method Summary

Methods
`Integer` `getSoLinger()` Please note that enabling `SO_LINGER` in Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.
`SSLContext` `getSslContext()`
`Boolean` `isKeepAlive()`
`Boolean` `isOobInline()`
`boolean` `isSecured()` Tells if the session provides some encryption (SSL/TLS)
`Boolean` `isTcpNoDelay()`
`void` `setKeepAlive(boolean keepAlive)`
`void` `setOobInline(boolean oobInline)`
`void` `setSoLinger(int soLinger)` Please note that enabling `SO_LINGER` in Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.
`void` `setSslContext(SSLContext sslContext)` Inject a `SSLContex` valid for the session.
`void` `setTcpNoDelay(boolean tcpNoDelay)`

### Methods inherited from class org.apache.mina.session.AbstractIoSessionConfig

`getIdleTimeInMillis, getReadBufferSize, getSendBufferSize, getTimeout, getTrafficClass, isReuseAddress, setIdleTimeInMillis, setReadBufferSize, setReuseAddress, setSendBufferSize, setTimeout, setTrafficClass, setTrafficClass`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.mina.api.IoSessionConfig

`getIdleTimeInMillis, getReadBufferSize, getSendBufferSize, getTimeout, getTrafficClass, isReuseAddress, setIdleTimeInMillis, setReadBufferSize, setReuseAddress, setSendBufferSize, setTimeout, setTrafficClass, setTrafficClass`

### Constructor Detail

#### DefaultTcpSessionConfig

    public DefaultTcpSessionConfig()

### Method Detail

#### isTcpNoDelay

    public Boolean isTcpNoDelay()

Specified by:
  `isTcpNoDelay` in interface `TcpSessionConfig`
See Also:
  `Socket.getTcpNoDelay()`

#### setTcpNoDelay

    public void setTcpNoDelay(boolean tcpNoDelay)

Specified by:
  `setTcpNoDelay` in interface `TcpSessionConfig`
See Also:
  `Socket.setTcpNoDelay(boolean)`

#### isKeepAlive

    public Boolean isKeepAlive()

Specified by:
  `isKeepAlive` in interface `TcpSessionConfig`
See Also:
  `return `null` if the default system value is used`

#### setKeepAlive

    public void setKeepAlive(boolean keepAlive)

Specified by:
  `setKeepAlive` in interface `TcpSessionConfig`
See Also:
  `Socket.setKeepAlive(boolean)`

#### isOobInline

    public Boolean isOobInline()

Specified by:
  `isOobInline` in interface `TcpSessionConfig`
See Also:
  `return `null` if the default system value is used`

#### setOobInline

    public void setOobInline(boolean oobInline)

Specified by:
  `setOobInline` in interface `TcpSessionConfig`
See Also:
  `Socket.setOOBInline(boolean)`

#### getSoLinger

    public Integer getSoLinger()

Please note that enabling `SO_LINGER` in Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.

Specified by:
  `getSoLinger` in interface `TcpSessionConfig`
See Also:
  `Socket.getSoLinger()`, Sun Bug Database return `null` if the default system value is used

#### setSoLinger

    public void setSoLinger(int soLinger)

Please note that enabling `SO_LINGER` in Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.

Specified by:
  `setSoLinger` in interface `TcpSessionConfig`
Parameters:
  `soLinger` - Please specify a negative value to disable `SO_LINGER`.
See Also:
  `Socket.setSoLinger(boolean, int)`, Sun Bug Database

#### setSslContext

    public void setSslContext(SSLContext sslContext)

Inject a `SSLContex` valid for the session. This `SSLContex` will be used by the SSLEngine to handle secured connections.
The `SSLContex` must have been created and initialized before being injected in the configuration.
By setting a `SSLContext`, the session switch to secured.

Specified by:
  `setSslContext` in interface `TcpSessionConfig`
Parameters:
  `sslContext` - The configured `SSLContex`.

#### getSslContext

    public SSLContext getSslContext()

Specified by:
  `getSslContext` in interface `TcpSessionConfig`
Returns:
  The `SSLContext` instance stored in the configuration.

#### isSecured

    public boolean isSecured()

Tells if the session provides some encryption (SSL/TLS)

Specified by:
  `isSecured` in interface `TcpSessionConfig`
Returns:
  `true` if the session is secured