nauful / LibUA

Open-source OPC UA client and server library
Apache License 2.0
262 stars 94 forks source link

Acknowledge Message ReceiveBufferSize/SendBuffersize 'shall not be larger than what the Client requested'... #172

Closed bevanweiss closed 4 months ago

bevanweiss commented 4 months ago

https://reference.opcfoundation.org/Core/Part6/v104/docs/7.1.2.4

I've had issues lately trying to get a Siemens S7-1500 talking to LibUA, and it appears this is because the S7-1500 sends 8192bytes for both Send / Receive buffer sizes, and then when LibUA responds with 64kB, the PLC cancels the connection.

OPC-UA standard doesn't require Max Message Size to align between client / server, but existing code went with minimum.. so I kept this.

I'm unsure in what situation this line would have applied previously.

config.TL.RemoteConfig.MaxMessageSize = config.TL.LocalConfig.MaxMessageSize;

OPC-UA standard allows both sides to send 0 for 'infinite message size allowed', which would typically align with 0 for maximum number of chunks also.