public class OioSocketChannel extends OioByteStreamChannel implements SocketChannel
SocketChannel
AbstractChannel.AbstractUnsafe
Channel.Unsafe
SO_TIMEOUT
Constructor and Description |
---|
OioSocketChannel()
用新的
Socket 创建一个新实例
|
OioSocketChannel(Channel parent, java.net.Socket socket)
从给定的
Socket 创建一个新的实例
|
OioSocketChannel(java.net.Socket socket)
从给定的
Socket 创建一个新实例
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkInputShutdown() |
OioSocketChannelConfig |
config()
返回此频道的配置。
|
protected void |
doBind(java.net.SocketAddress localAddress)
将 Channel 绑定到SocketAddress
|
protected void |
doClose()
关闭 Channel
|
protected void |
doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
如果指定了localAddress,则使用给定的localAddress连接到远程对等,否则连接到
null 。
|
protected void |
doDisconnect()
断开这 Channel 从它的远程对等
|
protected int |
doReadBytes(ByteBuf buf)
从底层套接字读取字节。
|
protected void |
doShutdownOutput()
当条件证明关闭通道的输出部分时调用。
|
boolean |
isActive()
如果 Channel 处于活动状态且已连接,则返回true 。
|
boolean |
isInputShutdown()
确定此通道的输入端是否已关闭。
|
boolean |
isOpen()
如果 Channel 已打开并且稍后可能会激活,则返回true
|
boolean |
isOutputShutdown() |
boolean |
isShutdown()
确定此通道的输入和输出是否都已关闭。
|
java.net.InetSocketAddress |
localAddress()
返回此通道绑定的本地地址。
|
protected java.net.SocketAddress |
localAddress0()
返回本地绑定的
SocketAddress 。
|
ServerSocketChannel |
parent()
返回此频道的父级。
|
java.net.InetSocketAddress |
remoteAddress()
返回此通道连接到的远程地址。
|
protected java.net.SocketAddress |
remoteAddress0()
返回 SocketAddress 其中Channel 被连接到。
|
protected void |
setReadPending(boolean readPending)
已过时。
|
ChannelFuture |
shutdown()
将关闭此通道的输入和输出端。
|
ChannelFuture |
shutdown(ChannelPromise promise)
将关闭此通道的输入和输出端。
|
ChannelFuture |
shutdownInput()
关闭此通道的输入端。
|
ChannelFuture |
shutdownInput(ChannelPromise promise)
将关闭输入并通知 ChannelPromise 。
|
ChannelFuture |
shutdownOutput() |
ChannelFuture |
shutdownOutput(ChannelPromise promise)
将关闭输出并通知 ChannelPromise 。
|
activate, available, doWriteBytes, doWriteFileRegion
doRead, doWrite, filterOutboundMessage, metadata
clearReadPending, doBeginRead, isCompatible, isReadPending, newUnsafe
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doDeregister, doRegister, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
attr, hasAttr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isRegistered, isWritable, metadata, 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 OioSocketChannel()
Socket
创建一个新实例
public OioSocketChannel(java.net.Socket socket)
Socket
创建一个新实例
socket
- 此实例使用的
Socket
public ServerSocketChannel parent()
Channel
parent
,界面
Channel
parent
在界面
SocketChannel
parent
,上课时间
AbstractChannel
null
如果此频道没有父频道。
public OioSocketChannelConfig config()
Channel
config
在界面
Channel
config
,界面
SocketChannel
public boolean isActive()
Channel
Channel
处于活动状态且已连接,则返回true
。
isActive
在界面
Channel
isActive
,课时
OioByteStreamChannel
public boolean isOutputShutdown()
isOutputShutdown
在界面
DuplexChannel
Socket.isOutputShutdown()
public boolean isInputShutdown()
AbstractOioByteChannel
isInputShutdown
,界面
DuplexChannel
isInputShutdown
在课堂上
AbstractOioByteChannel
true
如果此通道的输入端已关闭。
public boolean isShutdown()
DuplexChannel
isShutdown
在界面
DuplexChannel
@UnstableApi protected final void doShutdownOutput() throws java.lang.Exception
AbstractChannel
doShutdownOutput
在课堂上
AbstractChannel
java.lang.Exception
public ChannelFuture shutdownOutput()
shutdownOutput
在界面
DuplexChannel
Socket.shutdownOutput()
public ChannelFuture shutdownInput()
AbstractOioByteChannel
shutdownInput
在界面
DuplexChannel
shutdownInput
在课堂
AbstractOioByteChannel
Socket.shutdownInput()
public ChannelFuture shutdown()
DuplexChannel
复制的描述
shutdown
,界面
DuplexChannel
protected int doReadBytes(ByteBuf buf) throws java.lang.Exception
AbstractOioByteChannel
doReadBytes
在课堂上
OioByteStreamChannel
buf
- 写入读取字节的ByteBuf
java.lang.Exception
- 发生错误时抛出
public ChannelFuture shutdownOutput(ChannelPromise promise)
DuplexChannel
复制的描述
ChannelPromise
。
shutdownOutput
在界面
DuplexChannel
Socket.shutdownOutput()
public ChannelFuture shutdownInput(ChannelPromise promise)
DuplexChannel
复制的描述
ChannelPromise
。
shutdownInput
在界面
DuplexChannel
Socket.shutdownInput()
public ChannelFuture shutdown(ChannelPromise promise)
DuplexChannel
shutdown
在界面
DuplexChannel
promise
- 将在两次关机操作完成时完成。
public java.net.InetSocketAddress localAddress()
Channel
SocketAddress
应该被放入更具体的类型,例如InetSocketAddress
以检索详细信息。
localAddress
,界面
Channel
localAddress
在界面
SocketChannel
localAddress
在课堂上
AbstractChannel
null
如果此通道未绑定。
public java.net.InetSocketAddress remoteAddress()
Channel
SocketAddress
被假定为更具体的类型,如InetSocketAddress
以检索详细信息。
remoteAddress
在界面
Channel
remoteAddress
,界面
SocketChannel
remoteAddress
AbstractChannel
null
如果此通道未连接。
如果此通道未连接,但可以接收来自任意远程地址的消息(例如DatagramChannel
,请使用DefaultAddressedEnvelope.recipient()
确定收到消息的来源,因为此方法将返回null
。
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 void doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.Exception
AbstractOioChannel
null
。
doConnect
在课堂上
AbstractOioChannel
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
在课堂上
OioByteStreamChannel
java.lang.Exception
protected boolean checkInputShutdown()
@Deprecated protected void setReadPending(boolean readPending)
setReadPending
在课堂上
AbstractOioChannel
Copyright © 2008–2018 The Netty Project. All rights reserved.