Skip to content

Commit

Permalink
discard request while receive a error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mei-rune committed Jul 5, 2014
1 parent e1d41e6 commit 568f9a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion udp_client.go
Expand Up @@ -347,9 +347,14 @@ func (client *UdpClient) SendAndRecv(request PDU, timeout time.Duration) (respon
client.client_c <- cr

res := <-cr.c

response = res.response
e = res.e
releaseRequest(res)
if nil == e {
releaseRequest(res)
} else {
close(cr.c) // ensure send result failed while timeout is first.
}
return response, e
}

Expand Down

0 comments on commit 568f9a5

Please sign in to comment.