public class SessionDefault extends SessionBase
channel| 构造器和说明 |
|---|
SessionDefault(Channel channel) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
关闭
|
Handshake |
handshake()
获取握手信息
|
boolean |
isClosing()
是否关闭中
|
boolean |
isValid()
是否有效
|
InetSocketAddress |
localAddress()
获取本地地址
|
String |
param(String name)
获取握手参数
|
String |
paramOrDefault(String name,
String def)
获取握手参数或默认值
|
String |
path()
获取路径
|
void |
pathNew(String pathNew)
设置新路径
|
void |
preclose()
关闭开始
|
void |
reconnect()
手动重连(一般是自动)
|
InetSocketAddress |
remoteAddress()
获取远程地址
|
void |
reply(Message from,
Entity entity)
答复
|
void |
replyEnd(Message from,
Entity entity)
答复并结束(即最后一次答复)
|
SendStream |
send(String event,
Entity entity)
发送
|
void |
sendAlarm(Message from,
String alarm)
发送告警
|
RequestStream |
sendAndRequest(String event,
Entity entity,
long timeout)
发送并请求(限为一次答复;指定超时)
|
SubscribeStream |
sendAndSubscribe(String event,
Entity entity,
long timeout)
发送并订阅(答复结束之前,不限答复次数)
|
void |
sendPing()
手动发送 Ping(一般是自动)
|
attr, attrDel, attrHas, attrMap, attrOrDefault, attrPut, generateId, liveTime, sessionIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloseStarting, sendAndRequest, sendAndSubscribepublic SessionDefault(Channel channel)
public boolean isValid()
public boolean isClosing()
Sessionpublic InetSocketAddress remoteAddress() throws IOException
IOExceptionpublic InetSocketAddress localAddress() throws IOException
IOExceptionpublic Handshake handshake()
public String paramOrDefault(String name, String def)
name - 名字def - 默认值public String path()
public void pathNew(String pathNew)
public void reconnect()
throws IOException
IOExceptionpublic void sendPing()
throws IOException
IOExceptionpublic void sendAlarm(Message from, String alarm) throws IOException
SessionIOExceptionpublic SendStream send(String event, Entity entity) throws IOException
event - 事件entity - 实体IOExceptionpublic RequestStream sendAndRequest(String event, Entity entity, long timeout) throws IOException
event - 事件entity - 实体timeout - 超时(单位:毫秒)IOExceptionpublic SubscribeStream sendAndSubscribe(String event, Entity entity, long timeout) throws IOException
event - 事件entity - 实体timeout - 超时(单位:毫秒)IOExceptionpublic void reply(Message from, Entity entity) throws IOException
from - 来源消息entity - 实体IOExceptionpublic void replyEnd(Message from, Entity entity) throws IOException
from - 来源消息entity - 实体IOExceptionpublic void preclose()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionCopyright © 2024. All rights reserved.