go-routeros / routeros

Go library for accessing Mikrotik devices using the RouterOS API
MIT License
196 stars 51 forks source link

Fix handling command response when !trap is received #16

Closed v12 closed 3 years ago

v12 commented 3 years ago

Even though !trap message returns an error, command still completes with the !done sentence sent right after !trap, which needs to be processed too.

Only !fatal will not send anything after because the remote site is closing connection anyway (as per documentation):

!fatal can be received only in cases when API is closing connection:

In synchronous mode, if not processed, it clashes with the next command and wrong reply is processed.

andre-luiz-dos-santos commented 3 years ago

Thank you!