org.apache.mina.transport.bio

## Class BioUdpSession

- java.lang.Object
- - org.apache.mina.session.AbstractIoSession
  - - org.apache.mina.transport.bio.BioUdpSession

All Implemented Interfaces:
  IoSession, ReadFilterChainController, WriteFilterChainController

    public class BioUdpSession
    extends AbstractIoSession

A `IoSession` for `BioUdpServer`

Author:
  Apache MINA Project

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.mina.api.IoSession

`IoSession.SessionState`

### Field Summary

### Fields inherited from class org.apache.mina.session.AbstractIoSession

`config, idleChecker, secured, state`

### Fields inherited from interface org.apache.mina.api.IoSession

`SSL_HELPER`

### Constructor Summary

Constructors
Constructor and Description
`BioUdpSession(SocketAddress remoteAddress, BioUdpServer service, IdleChecker idleChecker)`

### Method Summary

Methods
`IoFuture<Void>` `close(boolean immediately)` Closes this session immediately or after all queued write requests are flushed.
`WriteRequest` `enqueueWriteRequest(WriteRequest writeRequest)` Internal method for enqueue write request after filter chain processing
`IoSessionConfig` `getConfig()` Gets the session configuration, it where the idle timeout are set and other transport specific configuration.
`SocketAddress` `getLocalAddress()` Gets the local address of the local peer.
`SocketAddress` `getRemoteAddress()` Returns the socket address of remote peer.
`boolean` `isReadSuspended()` Is read operation is suspended for this session.
`boolean` `isWriteSuspended()` Is write operation is suspended for this session.
`void` `resumeRead()` Resumes read operations for this session.
`void` `resumeWrite()` Resumes write operations for this session.
`void` `suspendRead()` Suspends read operations for this session.
`void` `suspendWrite()` Suspends write operations for this session.

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

`callReadNextFilter, callWriteNextFilter, changeState, getAttribute, getAttribute, getAttributeKeys, getCreationTime, getId, getLastIoTime, getLastReadTime, getLastWriteTime, getReadBytes, getService, getWrittenBytes, incrementWrittenBytes, initSecure, isClosed, isClosing, isConnected, isConnectedSecured, isCreated, isSecured, isSecuring, processException, processMessageReceived, processMessageSent, processMessageWriting, processSessionClosed, processSessionIdle, processSessionOpen, removeAttribute, setAttribute, setSecured, toString, write, writeWithFuture`

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

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

### Constructor Detail

#### BioUdpSession

    public BioUdpSession(SocketAddress remoteAddress,
                 BioUdpServer service,
                 IdleChecker idleChecker)

### Method Detail

#### getRemoteAddress

    public SocketAddress getRemoteAddress()

Returns the socket address of remote peer.

Returns:
  the remote socket address

#### getLocalAddress

    public SocketAddress getLocalAddress()

Gets the local address of the local peer.

Returns:
  the socket address of local machine which is associated with this session.

#### close

    public IoFuture<Void> close(boolean immediately)

Closes this session immediately or after all queued write requests are flushed. This operation is asynchronous. Wait for the returned `IoFuture` if you want to wait for the session actually closed. Once this method has been called, no incoming request will be accepted.

Parameters:
  `immediately` - `true` to close this session immediately. `false` to close this session after all queued write requests are flushed.
Returns:
  A `IoFuture` that will contains the session's state

#### suspendRead

    public void suspendRead()

Suspends read operations for this session.

#### suspendWrite

    public void suspendWrite()

Suspends write operations for this session.

#### resumeRead

    public void resumeRead()

Resumes read operations for this session.

#### resumeWrite

    public void resumeWrite()

Resumes write operations for this session.

#### isReadSuspended

    public boolean isReadSuspended()

Is read operation is suspended for this session.

Returns:
  `true` if suspended

#### isWriteSuspended

    public boolean isWriteSuspended()

Is write operation is suspended for this session.

Returns:
  `true` if suspended

#### getConfig

    public IoSessionConfig getConfig()

Gets the session configuration, it where the idle timeout are set and other transport specific configuration.

Returns:
  the session's configuration

#### enqueueWriteRequest

    public WriteRequest enqueueWriteRequest(WriteRequest writeRequest)

Internal method for enqueue write request after filter chain processing

Parameters:
  `writeRequest` - the message to put in the write request
Returns:
  the created write request