Skip to content

Commit

Permalink
Merge pull request #4 from rockyzh/master
Browse files Browse the repository at this point in the history
possible block of SetDeadline
  • Loading branch information
wxiaoguang authored Jun 4, 2017
2 parents 07e202b + 80c9002 commit 6e2931b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/kcp/kcpconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,8 @@ func (s *KCPConn) SetDeadline(t time.Time) error {
s.deadlineRead = t
s.deadlineWrite = t

s.chReadEvent <- struct{}{}
s.chWriteEvent <- struct{}{}
s.notifyReadEvent()
s.notifyWriteEvent()

return nil
}
Expand All @@ -505,7 +505,7 @@ func (s *KCPConn) SetReadDeadline(t time.Time) error {
defer s.mu.Unlock()
s.deadlineRead = t

s.chReadEvent <- struct{}{}
s.notifyReadEvent()

return nil
}
Expand All @@ -516,7 +516,7 @@ func (s *KCPConn) SetWriteDeadline(t time.Time) error {
defer s.mu.Unlock()
s.deadlineWrite = t

s.chWriteEvent <- struct{}{}
s.notifyWriteEvent()

return nil
}
Expand Down

0 comments on commit 6e2931b

Please sign in to comment.