Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Commit

Permalink
Check error
Browse files Browse the repository at this point in the history
  • Loading branch information
damnever committed Nov 2, 2017
1 parent 1244442 commit 5b7c941
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions birpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ func (cli *Client) Run(handler ClientHandler) error {
defer ticker.Stop()
tryConnect := tryConnectFunc(conf, cli.closed)

LOOP:
for {
select {
case <-cli.closed:
return nil
case err := <-conn.Err():
if nerr, ok := err.(net.Error); ok && nerr.Temporary() {
continue LOOP
}
handler.HandleError(err)
conn.Close()
rawConn, fatalErr := tryConnect()
Expand Down

0 comments on commit 5b7c941

Please sign in to comment.