Class NioDatagramSession
- java.lang.Object
-
- org.apache.mina.core.session.AbstractIoSession
-
- org.apache.mina.transport.socket.nio.NioSession
-
- org.apache.mina.transport.socket.nio.NioDatagramSession
-
- All Implemented Interfaces:
IoSession
class NioDatagramSession extends NioSession
AnIoSessionfor datagram transport (UDP/IP).
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.InetSocketAddresslocalAddress(package private) static TransportMetadataMETADATAprivate java.net.InetSocketAddressremoteAddress-
Fields inherited from class org.apache.mina.transport.socket.nio.NioSession
channel, processor
-
Fields inherited from class org.apache.mina.core.session.AbstractIoSession
CLOSE_REQUEST, config, MESSAGE_SENT_REQUEST
-
-
Constructor Summary
Constructors Constructor Description NioDatagramSession(IoService service, java.nio.channels.DatagramChannel channel, IoProcessor<NioSession> processor)Creates a new connector-side session instance.NioDatagramSession(IoService service, java.nio.channels.DatagramChannel channel, IoProcessor<NioSession> processor, java.net.SocketAddress remoteAddress)Creates a new acceptor-side session instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.nio.channels.DatagramChannelgetChannel()DatagramSessionConfiggetConfig()java.net.InetSocketAddressgetLocalAddress()java.net.InetSocketAddressgetRemoteAddress()java.net.InetSocketAddressgetServiceAddress()TransportMetadatagetTransportMetadata()-
Methods inherited from class org.apache.mina.transport.socket.nio.NioSession
getFilterChain, getProcessor, getSelectionKey, isActive, setSelectionKey
-
Methods inherited from class org.apache.mina.core.session.AbstractIoSession
close, close, closeNow, closeOnFlush, containsAttribute, decreaseReadBufferSize, decreaseScheduledBytesAndMessages, destroy, equals, getAttachment, getAttribute, getAttribute, getAttributeKeys, getAttributeMap, getBothIdleCount, getCloseFuture, getCreationTime, getCurrentWriteMessage, getCurrentWriteRequest, getHandler, getId, getIdleCount, getLastBothIdleTime, getLastIdleTime, getLastIoTime, getLastReaderIdleTime, getLastReadTime, getLastWriterIdleTime, getLastWriteTime, getReadBytes, getReadBytesThroughput, getReaderIdleCount, getReadMessages, getReadMessagesThroughput, getScheduledWriteBytes, getScheduledWriteMessages, getService, getWriteRequestQueue, getWriterIdleCount, getWrittenBytes, getWrittenBytesThroughput, getWrittenMessages, getWrittenMessagesThroughput, hashCode, increaseIdleCount, increaseReadBufferSize, increaseReadBytes, increaseReadMessages, increaseScheduledWriteBytes, increaseScheduledWriteMessages, increaseWrittenBytes, increaseWrittenMessages, isBothIdle, isClosing, isConnected, isIdle, isReaderIdle, isReadSuspended, isScheduledForFlush, isSecured, isWriterIdle, isWriteSuspended, notifyIdleness, notifyIdleSession, offerClosedReadFuture, offerFailedReadFuture, offerReadFuture, read, removeAttribute, removeAttribute, replaceAttribute, resumeRead, resumeWrite, scheduledForFlush, setAttachment, setAttribute, setAttribute, setAttributeIfAbsent, setAttributeIfAbsent, setAttributeMap, setCurrentWriteRequest, setScheduledForFlush, setScheduledWriteBytes, setScheduledWriteMessages, setWriteRequestQueue, suspendRead, suspendWrite, toString, unscheduledForFlush, updateThroughput, write, write
-
-
-
-
Field Detail
-
METADATA
static final TransportMetadata METADATA
-
localAddress
private final java.net.InetSocketAddress localAddress
-
remoteAddress
private final java.net.InetSocketAddress remoteAddress
-
-
Constructor Detail
-
NioDatagramSession
NioDatagramSession(IoService service, java.nio.channels.DatagramChannel channel, IoProcessor<NioSession> processor, java.net.SocketAddress remoteAddress)
Creates a new acceptor-side session instance.
-
NioDatagramSession
NioDatagramSession(IoService service, java.nio.channels.DatagramChannel channel, IoProcessor<NioSession> processor)
Creates a new connector-side session instance.
-
-
Method Detail
-
getConfig
public DatagramSessionConfig getConfig()
- Specified by:
getConfigin interfaceIoSession- Overrides:
getConfigin classAbstractIoSession- Returns:
- the configuration of this session.
-
getChannel
java.nio.channels.DatagramChannel getChannel()
- Specified by:
getChannelin classNioSession- Returns:
- The ByteChannel associated with this
IoSession
-
getTransportMetadata
public TransportMetadata getTransportMetadata()
- Returns:
- the
TransportMetadatathat this session runs on.
-
getRemoteAddress
public java.net.InetSocketAddress getRemoteAddress()
- Returns:
- the socket address of remote peer.
-
getLocalAddress
public java.net.InetSocketAddress getLocalAddress()
- Returns:
- the socket address of local machine which is associated with this session.
-
getServiceAddress
public java.net.InetSocketAddress getServiceAddress()
- Specified by:
getServiceAddressin interfaceIoSession- Overrides:
getServiceAddressin classAbstractIoSession- Returns:
- the socket address of the
IoServicelistens to to manage this session. If this session is managed byIoAcceptor, it returns theSocketAddresswhich is specified as a parameter ofIoAcceptor.bind(). If this session is managed byIoConnector, this method returns the same address with that ofIoSession.getRemoteAddress().
-
-