public interface ClientSession extends Closeable
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
isValid()
是否有效
|
void |
reconnect()
手动重连(一般是自动)
|
SendStream |
send(String event,
Entity entity)
发送
|
default RequestStream |
sendAndRequest(String event,
Entity entity)
发送并请求
|
RequestStream |
sendAndRequest(String event,
Entity entity,
long timeout)
发送并请求
|
default SubscribeStream |
sendAndSubscribe(String event,
Entity entity)
发送并订阅(答复结束之前,不限答复次数)
|
SubscribeStream |
sendAndSubscribe(String event,
Entity entity,
long timeout)
发送并订阅(答复结束之前,不限答复次数)
|
String |
sessionId()
获取会话Id
|
boolean isValid()
String sessionId()
void reconnect()
throws IOException
IOExceptionSendStream send(String event, Entity entity) throws IOException
event - 事件entity - 实体IOExceptiondefault RequestStream sendAndRequest(String event, Entity entity) throws IOException
event - 事件entity - 实体IOExceptionRequestStream sendAndRequest(String event, Entity entity, long timeout) throws IOException
event - 事件entity - 实体timeout - 超时(单位:毫秒)IOExceptiondefault SubscribeStream sendAndSubscribe(String event, Entity entity) throws IOException
event - 事件entity - 实体IOExceptionSubscribeStream sendAndSubscribe(String event, Entity entity, long timeout) throws IOException
event - 事件entity - 实体timeout - 超时(单位:毫秒)IOExceptionCopyright © 2024. All rights reserved.