|
@ -1,7 +1,6 @@ |
|
|
package tmspcli |
|
|
package tmspcli |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"fmt" |
|
|
|
|
|
"net" |
|
|
"net" |
|
|
"sync" |
|
|
"sync" |
|
|
"time" |
|
|
"time" |
|
@ -50,7 +49,7 @@ RETRY_LOOP: |
|
|
if cli.mustConnect { |
|
|
if cli.mustConnect { |
|
|
return err |
|
|
return err |
|
|
} else { |
|
|
} else { |
|
|
fmt.Printf("tmsp.grpcClient failed to connect to %v. Retrying...\n", cli.addr) |
|
|
|
|
|
|
|
|
log.Warn(Fmt("tmsp.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) |
|
|
time.Sleep(time.Second * 3) |
|
|
time.Sleep(time.Second * 3) |
|
|
continue RETRY_LOOP |
|
|
continue RETRY_LOOP |
|
|
} |
|
|
} |
|
@ -75,7 +74,7 @@ func (cli *grpcClient) SetResponseCallback(resCb Callback) { |
|
|
|
|
|
|
|
|
func (cli *grpcClient) StopForError(err error) { |
|
|
func (cli *grpcClient) StopForError(err error) { |
|
|
cli.mtx.Lock() |
|
|
cli.mtx.Lock() |
|
|
fmt.Printf("Stopping tmsp.grpcClient for error: %v\n", err.Error()) |
|
|
|
|
|
|
|
|
log.Warn(Fmt("Stopping tmsp.grpcClient for error: %v\n", err.Error())) |
|
|
if cli.err == nil { |
|
|
if cli.err == nil { |
|
|
cli.err = err |
|
|
cli.err = err |
|
|
} |
|
|
} |
|
|