Skip to content

Commit

Permalink
feat(im) : send limit
Browse files Browse the repository at this point in the history
  • Loading branch information
steven committed Apr 9, 2022
1 parent 1a09e1d commit 768b8fd
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,8 @@ func (c *Cli) LastHeartBeat() int64 {

func (c *Cli) send(data []byte) error{
if len(c.buf) *10 > cap(c.buf) * 7 {

// 用户如果消息通道不通顺的话,主动将用户下线
c.log.Infof(fmt.Sprintf("im/client: 用户被下线 , token is %s ,len %v but user cap is %v",c.token,len(c.buf),cap(c.buf)))
// 记录当前用户被丢弃的信息
c.Offline()
return errors.New(fmt.Sprintf("im/client: too much data , user len %v but user cap is %s",len(c.buf),cap(c.buf)))
}

Expand Down

0 comments on commit 768b8fd

Please sign in to comment.