mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 19:46:57 +08:00
ws update
This commit is contained in:
parent
87ae907df1
commit
e794769eea
@ -34,12 +34,16 @@ type Server struct {
|
||||
//rpcServer *RpcServer
|
||||
}
|
||||
|
||||
func (s *Server) SetLongConnServer(LongConnServer LongConnServer) {
|
||||
s.LongConnServer = LongConnServer
|
||||
}
|
||||
|
||||
func (s *Server) Notification() *notification.Check {
|
||||
return s.notification
|
||||
}
|
||||
|
||||
func NewServer(rpcPort int, longConnServer LongConnServer) *Server {
|
||||
return &Server{rpcPort: rpcPort, LongConnServer: longConnServer, pushTerminal: []int{constant.IOSPlatformID, constant.AndroidPlatformID}}
|
||||
func NewServer(rpcPort int) *Server {
|
||||
return &Server{rpcPort: rpcPort, pushTerminal: []int{constant.IOSPlatformID, constant.AndroidPlatformID}}
|
||||
}
|
||||
|
||||
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 {
|
||||
return err
|
||||
}
|
||||
hubServer := NewServer(rpcPort, longServer)
|
||||
hubServer := NewServer(rpcPort)
|
||||
go hubServer.Start()
|
||||
longServer.SetMessageHandler(hubServer.Notification())
|
||||
hubServer.SetLongConnServer(longServer)
|
||||
go hubServer.LongConnServer.Run()
|
||||
wg.Wait()
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user