locka99 / opcua

A client and server implementation of the OPC UA specification written in Rust
Mozilla Public License 2.0
501 stars 131 forks source link

Configurable MAX_BUFFER_SIZE #229

Open pascalporedda opened 2 years ago

pascalporedda commented 2 years ago

Hello,

we've been digging down a rabbit hole of debugging why our server responses were discarded / not being processed by the OPC client. We first thought that it might be related to issue #223, as the error message we got was the same:

INFO opcua::client::comms::tcp_transport - Discarding chunk marked in as final error

We applied the fix, but that didn't help us out. So we looked further and pinned it down to the property MAX_BUFFER_SIZE: https://github.com/locka99/opcua/blob/master/lib/src/client/session/session_state.rs#L161

The property limit is actually exceeded by our server's response when we invoke a method call on the OPC server.

Our server responds with a JSON String which is around 130.000 characters long, which definitely exceeds the limit. We have tried configuring all sorts of properties in the client .yml, but none of them affected this property.

Yes, the server's response is really huge, but that's something we can't change.

Would it be possible for you to add a config option to allow overriding the default?