public class NioSctpChannel extends AbstractNioMessageChannel implements SctpChannel
SctpChannel
使用非阻塞模式并允许读/写SctpMessage
s到底层SctpChannel
。
请注意,并非所有的操作系统都支持SCTP。
请参阅操作系统的文档,了解您需要如何使用它。
此功能也仅在Java 7+上受支持。
AbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafe
AbstractChannel.AbstractUnsafe
Channel.Unsafe
readInterestOp
Constructor and Description |
---|
NioSctpChannel()
创建一个新的实例
|
NioSctpChannel(Channel parent, com.sun.nio.sctp.SctpChannel sctpChannel)
创建一个新的实例
|
NioSctpChannel(com.sun.nio.sctp.SctpChannel sctpChannel)
使用
SctpChannel 创建一个新实例
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.net.InetSocketAddress> |
allLocalAddresses()
返回SCTP通道的所有本地地址。
|
java.util.Set<java.net.InetSocketAddress> |
allRemoteAddresses()
返回SCTP服务器通道的所有远程地址。
|
com.sun.nio.sctp.Association |
association()
返回底层的SCTP关联。
|
ChannelFuture |
bindAddress(java.net.InetAddress localAddress)
将地址绑定到已绑定的通道以启用多宿主。
|
ChannelFuture |
bindAddress(java.net.InetAddress localAddress, ChannelPromise promise)
将地址绑定到已绑定的通道以启用多宿主。
|
SctpChannelConfig |
config()
返回通道的 SctpChannelConfig 配置。
|
protected void |
doBind(java.net.SocketAddress localAddress)
将 Channel 绑定到SocketAddress
|
protected void |
doClose()
关闭 Channel
|
protected boolean |
doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
连接到远程对等
|
protected void |
doDisconnect()
将此 Channel 从其远程对等方断开
|
protected void |
doFinishConnect()
完成连接
|
protected int |
doReadMessages(java.util.List<java.lang.Object> buf)
将消息读入给定数组并返回读取的数量。
|
protected boolean |
doWriteMessage(java.lang.Object msg, ChannelOutboundBuffer in)
写下消息到底层
Channel 。
|
protected java.lang.Object |
filterOutboundMessage(java.lang.Object msg)
在将新消息添加到此 AbstractChannel 的ChannelOutboundBuffer 时调用 ,以便Channel 实现将消息转换为另一个。
|
boolean |
isActive()
如果 Channel 处于活动状态且已连接,则返回true 。
|
protected com.sun.nio.sctp.SctpChannel |
javaChannel() |
java.net.InetSocketAddress |
localAddress()
返回此通道绑定的本地地址。
|
protected java.net.SocketAddress |
localAddress0()
返回本地绑定的
SocketAddress 。
|
ChannelMetadata |
metadata()
返回 ChannelMetadata 的的Channel 其描述的性质Channel 。
|
SctpServerChannel |
parent()
返回此频道的父级。
|
java.net.InetSocketAddress |
remoteAddress()
返回此通道连接到的远程地址。
|
protected java.net.SocketAddress |
remoteAddress0()
返回 SocketAddress 其中Channel 被连接到。
|
ChannelFuture |
unbindAddress(java.net.InetAddress localAddress)
从通道的多址地址列表中解除绑定地址。
|
ChannelFuture |
unbindAddress(java.net.InetAddress localAddress, ChannelPromise promise)
从通道的多址地址列表中解除绑定地址。
|
closeOnReadError, continueOnWriteError, doBeginRead, doWrite, newUnsafe
clearReadPending, doDeregister, doRegister, eventLoop, isCompatible, isOpen, isReadPending, newDirectBuffer, newDirectBuffer, selectionKey, setReadPending, unsafe
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doShutdownOutput, equals, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, voidPromise, write, write, writeAndFlush, writeAndFlush
attr, hasAttr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isOpen, isRegistered, isWritable, pipeline, read, unsafe
attr, hasAttr
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlush
public NioSctpChannel()
public NioSctpChannel(com.sun.nio.sctp.SctpChannel sctpChannel)
SctpChannel
创建一个新实例
public NioSctpChannel(Channel parent, com.sun.nio.sctp.SctpChannel sctpChannel)
parent
- Channel
,它是此NioSctpChannel
或null
的母公司。
sctpChannel
- 底层
SctpChannel
public java.net.InetSocketAddress localAddress()
Channel
复制的描述
SocketAddress
应该被放入更具体的类型,例如InetSocketAddress
以检索详细信息。
localAddress
在界面
Channel
localAddress
在界面
SctpChannel
localAddress
在课堂上
AbstractChannel
null
如果此通道未绑定。
public java.net.InetSocketAddress remoteAddress()
Channel
复制的描述
SocketAddress
应该被放入更具体的类型,例如InetSocketAddress
以检索详细信息。
remoteAddress
,界面
Channel
remoteAddress
,界面
SctpChannel
remoteAddress
在课堂上
AbstractChannel
null
如果此通道未连接。
如果此通道未连接,但它可以接收来自任意远程地址的消息(例如DatagramChannel
,请使用DefaultAddressedEnvelope.recipient()
确定接收消息的来源,因为此方法将返回null
。
public SctpServerChannel parent()
Channel
复制的描述
parent
在界面
Channel
parent
在界面
SctpChannel
parent
在课堂上
AbstractChannel
null
如果此频道没有父频道。
public ChannelMetadata metadata()
Channel
复制的描述
ChannelMetadata
的的Channel
其描述的性质Channel
。
public com.sun.nio.sctp.Association association()
SctpChannel
association
在界面
SctpChannel
public java.util.Set<java.net.InetSocketAddress> allLocalAddresses()
SctpChannel
复制的描述
allLocalAddresses
在界面
SctpChannel
public SctpChannelConfig config()
SctpChannel
复制的描述
SctpChannelConfig
配置。
config
在界面
Channel
config
在界面
SctpChannel
public java.util.Set<java.net.InetSocketAddress> allRemoteAddresses()
SctpChannel
复制的描述
allRemoteAddresses
在界面
SctpChannel
protected com.sun.nio.sctp.SctpChannel javaChannel()
javaChannel
在课堂上
AbstractNioChannel
protected java.net.SocketAddress localAddress0()
AbstractChannel
SocketAddress
。
localAddress0
的
AbstractChannel
protected java.net.SocketAddress remoteAddress0()
AbstractChannel
SocketAddress
其中Channel
被连接到。
remoteAddress0
在课堂上
AbstractChannel
protected void doBind(java.net.SocketAddress localAddress) throws java.lang.Exception
AbstractChannel
Channel
绑定到SocketAddress
doBind
在课堂上
AbstractChannel
java.lang.Exception
protected boolean doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.Exception
AbstractNioChannel
doConnect
在课堂上
AbstractNioChannel
java.lang.Exception
protected void doFinishConnect() throws java.lang.Exception
AbstractNioChannel
doFinishConnect
在课堂上
AbstractNioChannel
java.lang.Exception
protected void doDisconnect() throws java.lang.Exception
AbstractChannel
Channel
从其远程对等方断开
doDisconnect
的
AbstractChannel
java.lang.Exception
protected void doClose() throws java.lang.Exception
AbstractChannel
Channel
doClose
在课堂上
AbstractNioChannel
java.lang.Exception
protected int doReadMessages(java.util.List<java.lang.Object> buf) throws java.lang.Exception
AbstractNioMessageChannel
doReadMessages
在课堂上
AbstractNioMessageChannel
java.lang.Exception
protected boolean doWriteMessage(java.lang.Object msg, ChannelOutboundBuffer in) throws java.lang.Exception
AbstractNioMessageChannel
Channel
写一条消息。
doWriteMessage
在课堂上
AbstractNioMessageChannel
true
当且仅当消息已被写入
java.lang.Exception
protected final java.lang.Object filterOutboundMessage(java.lang.Object msg) throws java.lang.Exception
AbstractChannel
AbstractChannel
的ChannelOutboundBuffer
时调用 ,以便Channel
实现将消息转换为另一个消息。
(例如堆缓冲区 - >直接缓冲区)
filterOutboundMessage
在课堂上
AbstractChannel
java.lang.Exception
public ChannelFuture bindAddress(java.net.InetAddress localAddress)
SctpChannel
bindAddress
在界面
SctpChannel
public ChannelFuture bindAddress(java.net.InetAddress localAddress, ChannelPromise promise)
SctpChannel
bindAddress
在界面
SctpChannel
public ChannelFuture unbindAddress(java.net.InetAddress localAddress)
SctpChannel
复制的描述
unbindAddress
在界面
SctpChannel
public ChannelFuture unbindAddress(java.net.InetAddress localAddress, ChannelPromise promise)
SctpChannel
unbindAddress
在界面
SctpChannel
Copyright © 2008–2018 The Netty Project. All rights reserved.