gopcua / opcua

Native Go OPC-UA library
MIT License
863 stars 263 forks source link

[Subscribe] Subscribe.Monitor response, StatusCode is not correct. #352

Open ymmemo opened 4 years ago

ymmemo commented 4 years ago

Hi,team , I tried to subscribe to some abnormal nodes like: opcua server-node information Ex:StatusBadWaitingForInitialData(0x80320000) or StatusUncertain(0x40000000)

Subscribe.Monitor response code resp, err := sub.Monitor(ua.TimestampsToReturnBoth, toAdd...) if err != nil || resp.Results[0].StatusCode != ua.StatusOK { return err } I've checked and the resp.Results[0].StatusCode=0, why I can't get actual status code(Ex:0x80320000 or other value)?

Thank you, ymmemo

magiconair commented 4 years ago

Could this be related to #337 ?

magiconair commented 4 years ago

Since we are refactoring the subscription logic for the next release I would like to ask you to test the release candidate when we have it. Currently, the code in #385 is the most relevant.

magiconair commented 2 years ago

@ymmemo unless I'm missing something we are not modifying the response we are getting from the server. You should get the unmodified response from the server or the first status code that is not StatusOK in the error.

Which server are you testing this against? Can you provide a tcpdump?