diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-02-06 20:55:11 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-02-06 20:55:11 -0800 |
commit | 05895eb732031f516c0cdda583b9531a33bea075 (patch) | |
tree | 552479116a354b3282be41cc88fb580e5a0d3946 /server | |
parent | 3d5383fda440551c05542aafb560f0ec1618609b (diff) |
bmp: try to reconnect after write failure
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/bmp.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/server/bmp.go b/server/bmp.go index 27a278bc..bd748ed9 100644 --- a/server/bmp.go +++ b/server/bmp.go @@ -125,6 +125,7 @@ func (w *bmpWatcher) loop() error { buf, _ := i.Serialize() if _, err := newConn.Write(buf); err != nil { log.Warnf("failed to write to bmp server %s", server.host) + go w.tryConnect(server) break } req := &GrpcRequest{ @@ -138,6 +139,7 @@ func (w *bmpWatcher) loop() error { buf, _ = msg.Serialize() if _, err := newConn.Write(buf); err != nil { log.Warnf("failed to write to bmp server %s %s", server.host, err) + go w.tryConnect(server) return err } } |