org.apache.mina.api

## Interface IoSessionConfig

- All Known Subinterfaces:
    TcpSessionConfig, UdpSessionConfig
  All Known Implementing Classes:
    AbstractIoSessionConfig, DefaultTcpSessionConfig, DefaultUdpSessionConfig, ProxyTcpSessionConfig

      public interface IoSessionConfig

  The configuration of `IoSession`.
  Author:
    Apache MINA Project

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getIdleTimeInMillis(IdleStatus status)` Returns idle time for the specified type of idleness in milli-seconds.
    `Integer` | `getReadBufferSize()` Returns the size of the read buffer that I/O processor allocates per each read.
    `Integer` | `getSendBufferSize()`
    `Integer` | `getTimeout()` Get the SO_TIMEOUT set for this socket
    `int` | `getTrafficClass()`
    `Boolean` | `isReuseAddress()`
    `void` | `setIdleTimeInMillis(IdleStatus status, long ildeTimeInMilli)` Set the delay before an `IoSession` is considered idle for a given operation type (read/write/both) @see IdleStatus
    `void` | `setReadBufferSize(int readBufferSize)` Sets the size of the read buffer that I/O processor allocates per each read.
    `void` | `setReuseAddress(boolean reuseAddress)`
    `void` | `setSendBufferSize(int sendBufferSize)` Sets the size of the buffer that I/O processor allocates per each write.
    `void` | `setTimeout(int timeOut)` Sets the SO_TIMEOUT option for this socket
    `void` | `setTrafficClass(int trafficClass)` Set the ToS flag for this session
    `void` | `setTrafficClass(TrafficClassEnum trafficClass)` Set the ToS flag for this session

- - ### Method Detail

    - #### getReadBufferSize

          Integer getReadBufferSize()

      Returns the size of the read buffer that I/O processor allocates per each read. It's unusual to adjust this property because it's often adjusted automatically by the I/O processor.
      Returns:
        The buffer size, or null if its not set

    - #### setReadBufferSize

          void setReadBufferSize(int readBufferSize)

      Sets the size of the read buffer that I/O processor allocates per each read. It's unusual to adjust this property because it's often adjusted automatically by the I/O processor.
      Parameters:
        `readBufferSize` - The buffer size used to read data from the socket

    - #### getSendBufferSize

          Integer getSendBufferSize()

      See Also:
        `DatagramSocket.getSendBufferSize()`

    - #### setSendBufferSize

          void setSendBufferSize(int sendBufferSize)

      Sets the size of the buffer that I/O processor allocates per each write. It's unusual to adjust this property because it's often adjusted automatically by the I/O processor.
      Parameters:
        `sendBufferSize` - The buffer size used to send data into the socket

    - #### getIdleTimeInMillis

          long getIdleTimeInMillis(IdleStatus status)

      Returns idle time for the specified type of idleness in milli-seconds.
      Returns:
        the idle time in ms or `-1` if no idle time configured for this status
      See Also:
        `IdleStatus`

    - #### setIdleTimeInMillis

          void setIdleTimeInMillis(IdleStatus status,
                                 long ildeTimeInMilli)

      Set the delay before an `IoSession` is considered idle for a given operation type (read/write/both) @see IdleStatus
      Parameters:
        `status` - the type of idle (read/write/both) timeout to set
        `ildeTimeInMilli` - the timeout in milliseconds (`-1` for no idle detection on this status)

    - #### getTrafficClass

          int getTrafficClass()

      Returns:
        The ToS set for this session
      See Also:
        `Socket.getTrafficClass()`

    - #### setTrafficClass

          void setTrafficClass(TrafficClassEnum trafficClass)

      Set the ToS flag for this session
      Parameters:
        `trafficClass` - The ToS to set
      See Also:
        `Socket.setTrafficClass(int)`

    - #### setTrafficClass

          void setTrafficClass(int trafficClass)

      Set the ToS flag for this session
      Parameters:
        `trafficClass` - The ToS to set
      See Also:
        `Socket.setTrafficClass(int)`

    - #### isReuseAddress

          Boolean isReuseAddress()

      See Also:
        `Socket.getReuseAddress()`

    - #### setReuseAddress

          void setReuseAddress(boolean reuseAddress)

      See Also:
        `Socket.setReuseAddress(boolean)`, `return `null` if the default system value is used`

    - #### getTimeout

          Integer getTimeout()

      Get the SO_TIMEOUT set for this socket
      Returns:
        The Timeout, in milliseconds. 0 means infinite.
      See Also:
        `Socket.getSoTimeout()`, `DatagramSocket.getSoTimeout()`

    - #### setTimeout

          void setTimeout(int timeOut)

      Sets the SO_TIMEOUT option for this socket
      Parameters:
        `timeOut` - The timeout to set, in milliseconds. 0 means infinite
      See Also:
        `Socket.setSoTimeout(int)`, `DatagramSocket.setSoTimeout(int)`

Copyright © 2009–2013 Apache MINA Project. All rights reserved.