IoSession.StatereadByteBufferChannel, sendByteBufferChannel| Constructor and Description |
|---|
AioSession(AioSocket socket)
构造函数
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
close()
关闭会话
|
protected MessageSplitter |
getMessagePartition()
获取消息分割处理类
|
boolean |
isConnected()
会话是否连接
|
boolean |
isOpen()
会话是否打开
|
int |
loaclPort()
获取本地端口
|
String |
localAddress()
获取本地 IP 地址
|
protected int |
read0(ByteBuffer buffer)
读取消息到缓冲区
|
String |
remoteAddress()
获取对端 IP 地址
|
int |
remotePort()
获取对端端口
|
void |
restart()
重连当前连接
|
protected int |
send0(ByteBuffer buffer)
发送消息
注意直接调用不会出发 onSent 事件
|
String |
toString() |
cancelIdle, checkIdle, containAttribute, enabledMessageSpliter, flush, getAttribute, getAttributes, getFlushedObjects, getHeartBeat, getIdleInterval, getMessageLoader, getReadByteBufferChannel, getSendByteBufferChannel, getSSLParser, getState, read, removeAttribute, send, sendByBuffer, setAttribute, setFlushedObjects, setHeartBeat, setIdleInterval, setSSLParser, socketContext, syncRead, syncSend, waitpublic AioSession(AioSocket socket)
socket - AioSocket对象public String localAddress()
IoSessionlocalAddress in class IoSession<AioSocket>public int loaclPort()
IoSessionpublic String remoteAddress()
IoSessionremoteAddress in class IoSession<AioSocket>public int remotePort()
IoSessionremotePort in class IoSession<AioSocket>protected int read0(ByteBuffer buffer) throws IOException
IoSessionread0 in class IoSession<AioSocket>buffer - 接收数据的缓冲区IOException - IO 异常protected int send0(ByteBuffer buffer) throws IOException
IoSessionsend0 in class IoSession<AioSocket>buffer - 发送缓冲区IOException - IO 异常protected MessageSplitter getMessagePartition()
IoSessiongetMessagePartition in class IoSession<AioSocket>public boolean isConnected()
IoSessionisConnected in class IoSession<AioSocket>public boolean isOpen()
public boolean close()
IoSessionpublic void restart()
throws IOException,
RestartException
IOException - IO 异常RestartException - 重新启动的异常Copyright © 2019 Voovan. All rights reserved.