You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2017/09/21 01:47:26 UTC

[mynewt-newtmgr] 01/03: nmxact - Don't report timeout on channel close.

This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newtmgr.git

commit 26dd217f58da1b7ccd3c01fd963f635901cd6c89
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Wed Sep 20 18:45:38 2017 -0700

    nmxact - Don't report timeout on channel close.
---
 nmxact/mgmt/transceiver.go | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/nmxact/mgmt/transceiver.go b/nmxact/mgmt/transceiver.go
index 1fb2d08..6d5f957 100644
--- a/nmxact/mgmt/transceiver.go
+++ b/nmxact/mgmt/transceiver.go
@@ -98,8 +98,10 @@ func (t *Transceiver) txPlain(txCb TxFn, req *nmp.NmpMsg, mtu int,
 			return nil, err
 		case rsp := <-nl.RspChan:
 			return rsp, nil
-		case <-nl.AfterTimeout(timeout):
-			return nil, nmxutil.NewRspTimeoutError("NMP timeout")
+		case _, ok := <-nl.AfterTimeout(timeout):
+			if ok {
+				return nil, nmxutil.NewRspTimeoutError("NMP timeout")
+			}
 		}
 	}
 }
@@ -139,8 +141,10 @@ func (t *Transceiver) txOmp(txCb TxFn, req *nmp.NmpMsg, mtu int,
 			return nil, err
 		case rsp := <-nl.RspChan:
 			return rsp, nil
-		case <-nl.AfterTimeout(timeout):
-			return nil, nmxutil.NewRspTimeoutError("NMP timeout")
+		case _, ok := <-nl.AfterTimeout(timeout):
+			if ok {
+				return nil, nmxutil.NewRspTimeoutError("NMP timeout")
+			}
 		}
 	}
 }
@@ -200,8 +204,10 @@ func (t *Transceiver) TxOic(txCb TxFn, req coap.Message, mtu int,
 			return nil, err
 		case rsp := <-ol.RspChan:
 			return rsp, nil
-		case <-ol.AfterTimeout(timeout):
-			return nil, nmxutil.NewRspTimeoutError("OIC timeout")
+		case _, ok := <-ol.AfterTimeout(timeout):
+			if ok {
+				return nil, nmxutil.NewRspTimeoutError("OIC timeout")
+			}
 		}
 	}
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" <co...@mynewt.apache.org>.