mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 19:32:17 +08:00 
			
		
		
		
	update to correct method name and comment.
This commit is contained in:
		
							parent
							
								
									a91a8b9c8b
								
							
						
					
					
						commit
						58cd8ee0a7
					
				@ -114,7 +114,7 @@ func (c *Client) readMessage() {
 | 
				
			|||||||
	c.conn.SetReadLimit(maxMessageSize)
 | 
						c.conn.SetReadLimit(maxMessageSize)
 | 
				
			||||||
	_ = c.conn.SetReadDeadline(pongWait)
 | 
						_ = c.conn.SetReadDeadline(pongWait)
 | 
				
			||||||
	c.conn.SetPingHandler(c.pingHandler)
 | 
						c.conn.SetPingHandler(c.pingHandler)
 | 
				
			||||||
	go c.heartbeat(c.hbCtx)
 | 
						go c.activeHeartbeat(c.hbCtx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for {
 | 
						for {
 | 
				
			||||||
		log.ZDebug(c.ctx, "readMessage")
 | 
							log.ZDebug(c.ctx, "readMessage")
 | 
				
			||||||
@ -240,7 +240,7 @@ func (c *Client) close() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	c.closed.Store(true)
 | 
						c.closed.Store(true)
 | 
				
			||||||
	c.conn.Close()
 | 
						c.conn.Close()
 | 
				
			||||||
	<-c.hbCtx.Done() // Close initiated heartbeat in server send.
 | 
						<-c.hbCtx.Done() // Close server-initiated heartbeat.
 | 
				
			||||||
	c.longConnServer.UnRegister(c)
 | 
						c.longConnServer.UnRegister(c)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -327,7 +327,8 @@ func (c *Client) writeBinaryMsg(resp Resp) error {
 | 
				
			|||||||
	return c.conn.WriteMessage(MessageBinary, encodedBuf)
 | 
						return c.conn.WriteMessage(MessageBinary, encodedBuf)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Client) heartbeat(ctx context.Context) {
 | 
					// Actively initiate Heartbeat when platform in Web.
 | 
				
			||||||
 | 
					func (c *Client) activeHeartbeat(ctx context.Context) {
 | 
				
			||||||
	if c.PlatformID == constant.WebPlatformID {
 | 
						if c.PlatformID == constant.WebPlatformID {
 | 
				
			||||||
		log.ZDebug(ctx, "server initiative send heartbeat start.")
 | 
							log.ZDebug(ctx, "server initiative send heartbeat start.")
 | 
				
			||||||
		ticker := time.NewTicker(pingPeriod)
 | 
							ticker := time.NewTicker(pingPeriod)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user