Support Board
Date/Time: Sat, 12 Jul 2025 11:45:31 +0000
Post From: Receiving bad SecurityDefinitionResponse messages from DTC server
[2020-06-11 16:39:00] |
User442651 - Posts: 25 |
Are you using Binary encoding and not Binary encoding with Variable Length Strings?
With binary encoding the size of messages are fixed and you can use the sizeof operator in the C++ language to check the structure sizes. Yes, binary encoding. I am using C#, but yes I know how to calculate structure sizes (so if my size #'s are off then there is a problem with the structure definition). ...The second problem is that looking at this question in isolation, the server can be sending more data because there are other messages sent at the same time.
What I meant is that the call to Stream.ReadAsync returns 388 bytes in that example, but now you helped me understand that the stream is not necessarily returning one message per read. I will see if that fixes the issue with "bad" messages once I fix this.This indicates a problem in your code. This should not happen. Furthermore, what is the purpose of telling us this.
This is not "in my code", per se. I simply wrap the socket in an SslStream and the .NET library handles encryption/decryption automatically from there. It is throwing a common exception that can apparently even be caused by hardware issues. The purpose of telling you this, was that I thought it was at least conceivable that a bad message from the DTC server could be the cause. |