mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 03:58:55 +08:00
ws update
This commit is contained in:
parent
87ae907df1
commit
e794769eea
@ -34,12 +34,16 @@ type Server struct {
|
|||||||
//rpcServer *RpcServer
|
//rpcServer *RpcServer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Server) SetLongConnServer(LongConnServer LongConnServer) {
|
||||||
|
s.LongConnServer = LongConnServer
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Server) Notification() *notification.Check {
|
func (s *Server) Notification() *notification.Check {
|
||||||
return s.notification
|
return s.notification
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewServer(rpcPort int, longConnServer LongConnServer) *Server {
|
func NewServer(rpcPort int) *Server {
|
||||||
return &Server{rpcPort: rpcPort, LongConnServer: longConnServer, pushTerminal: []int{constant.IOSPlatformID, constant.AndroidPlatformID}}
|
return &Server{rpcPort: rpcPort, pushTerminal: []int{constant.IOSPlatformID, constant.AndroidPlatformID}}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) OnlinePushMsg(context context.Context, req *msggateway.OnlinePushMsgReq) (*msggateway.OnlinePushMsgResp, error) {
|
func (s *Server) OnlinePushMsg(context context.Context, req *msggateway.OnlinePushMsgReq) (*msggateway.OnlinePushMsgResp, error) {
|
||||||
|
@ -22,9 +22,10 @@ func RunWsAndServer(rpcPort, wsPort, prometheusPort int) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
hubServer := NewServer(rpcPort, longServer)
|
hubServer := NewServer(rpcPort)
|
||||||
go hubServer.Start()
|
go hubServer.Start()
|
||||||
longServer.SetMessageHandler(hubServer.Notification())
|
longServer.SetMessageHandler(hubServer.Notification())
|
||||||
|
hubServer.SetLongConnServer(longServer)
|
||||||
go hubServer.LongConnServer.Run()
|
go hubServer.LongConnServer.Run()
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user