Skip to content

Commit

Permalink
fix async send timeout bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bg5sbk committed Feb 6, 2015
1 parent 59ccbcc commit ff07cdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (session *Session) AsyncSend(message Message, timeout time.Duration) AsyncW
case session.asyncSendChan <- asyncMessage{c, message}:
case <-session.closeChan:
c <- SendToClosedError
case <-time.After(time.Second * 5):
case <-time.After(timeout):
session.Close()
c <- AsyncSendTimeoutError
}
Expand Down Expand Up @@ -272,7 +272,7 @@ func (session *Session) asyncSendBuffer(buffer *OutBuffer, timeout time.Duration
case session.asyncSendBufferChan <- asyncBuffer{c, buffer}:
case <-session.closeChan:
c <- SendToClosedError
case <-time.After(time.Second * 5):
case <-time.After(timeout):
session.Close()
c <- AsyncSendTimeoutError
}
Expand Down

0 comments on commit ff07cdc

Please sign in to comment.