Skip to content

Commit fb21c65

Browse files
authored
Merge pull request #114 from ericsson-peiwuyang/17156
align with ASTFProgram in trex_astf_profile.py for recv and recv_msg API
2 parents 0e0f79e + 84ec3a7 commit fb21c65

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/com/cisco/trex/stateful/api/lowlevel/ASTFProgram.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ public void recv(int bytes, boolean clear) {
345345
* @param clear
346346
*/
347347
public void recv(long bytes, boolean clear) {
348+
if (clear) {
349+
this.totalRcvBytes = 0;
350+
}
348351
this.totalRcvBytes += bytes;
349352
fields.get(COMMANDS).add(new ASTFCmdRecv(totalRcvBytes, clear));
350353
}
@@ -388,6 +391,9 @@ public void recvMsg(int pkts, boolean clear) {
388391
* @param clear when reach the watermark clear the flow counter
389392
*/
390393
public void recvMsg(long pkts, boolean clear) {
394+
if (clear) {
395+
this.totalRcvBytes = 0;
396+
}
391397
this.totalRcvBytes += pkts;
392398
fields.get(COMMANDS).add(new ASTFCmdRecvMsg(this.totalRcvBytes, clear));
393399
}

0 commit comments

Comments
 (0)