mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-20 19:49:17 +08:00
ws update
This commit is contained in:
parent
a0d61769b2
commit
735c35bd0f
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
@ -159,6 +160,7 @@ func (c *Client) setAppBackgroundStatus(ctx context.Context, req Req) ([]byte, e
|
|||||||
func (c *Client) close() {
|
func (c *Client) close() {
|
||||||
c.w.Lock()
|
c.w.Lock()
|
||||||
defer c.w.Unlock()
|
defer c.w.Unlock()
|
||||||
|
c.closed = true
|
||||||
c.conn.Close()
|
c.conn.Close()
|
||||||
c.longConnServer.UnRegister(c)
|
c.longConnServer.UnRegister(c)
|
||||||
|
|
||||||
@ -173,7 +175,17 @@ func (c *Client) replyMessage(binaryReq *Req, err error, resp []byte) {
|
|||||||
_ = c.writeMsg(mReply)
|
_ = c.writeMsg(mReply)
|
||||||
}
|
}
|
||||||
func (c *Client) PushMessage(ctx context.Context, msgData *sdkws.MsgData) error {
|
func (c *Client) PushMessage(ctx context.Context, msgData *sdkws.MsgData) error {
|
||||||
return nil
|
data, err := proto.Marshal(msgData)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
resp := Resp{
|
||||||
|
ReqIdentifier: WSPushMsg,
|
||||||
|
OperationID: mcontext.GetOperationID(ctx),
|
||||||
|
Data: data,
|
||||||
|
}
|
||||||
|
return c.writeMsg(resp)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) KickOnlineMessage(ctx context.Context) error {
|
func (c *Client) KickOnlineMessage(ctx context.Context) error {
|
||||||
|
@ -31,7 +31,6 @@ type Server struct {
|
|||||||
prometheusPort int
|
prometheusPort int
|
||||||
LongConnServer LongConnServer
|
LongConnServer LongConnServer
|
||||||
pushTerminal []int
|
pushTerminal []int
|
||||||
//rpcServer *RpcServer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) SetLongConnServer(LongConnServer LongConnServer) {
|
func (s *Server) SetLongConnServer(LongConnServer LongConnServer) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user