mirror of https://gitee.com/stylefeng/roses
Socket添加关闭会话接口
parent
bf60703048
commit
da6e6c7e7c
|
@ -47,6 +47,15 @@ public interface SocketOperatorApi {
|
|||
**/
|
||||
void sendMsgOfAllUserSession(String msgType, Object msg);
|
||||
|
||||
/**
|
||||
* 根据会话id关闭会话
|
||||
*
|
||||
* @param socketId 会话id
|
||||
* @author majianguo
|
||||
* @date 2021/8/13 16:00
|
||||
**/
|
||||
void closeSocketBySocketId(String socketId);
|
||||
|
||||
/**
|
||||
* 监听指定类型消息
|
||||
* <p>
|
||||
|
|
|
@ -68,6 +68,11 @@ public class WebSocketOperator implements SocketOperatorApi {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeSocketBySocketId(String socketId) {
|
||||
SessionCenter.closed(socketId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void msgTypeCallback(String msgType, SocketMsgCallbackInterface callbackInterface) {
|
||||
SocketMessageCenter.setMessageListener(msgType, callbackInterface);
|
||||
|
|
Loading…
Reference in New Issue