OPCFoundation / UA-.NETStandard

OPC Unified Architecture .NET Standard
Other
1.9k stars 926 forks source link

Behaviour when the server ends the connection via TCP RST #2544

Closed KircMax closed 4 months ago

KircMax commented 4 months ago

Type of issue

Current Behavior

When the server sends a TCP Reset to close the connection after the client tries to send a KeepAlive: image there seems to be some sort of ReconnectHandling in Place since a new SecureChannel is created. BUT since the client does not activate the session on that channel every later ReadRequest will be responded to with BadSecureChannelIdInvalid (0x8022_0000)... I can also see the KeepAlive ReadRequests being responded to with BadSecureChannelIdInvalid ... As soon as I try to e.g. Read a variable later in the Client I will then get the BadSecureChannelIdInvalid Exception...

I could think of this not being a bug since the client was not explicitly triggered to do the KeepAlive and therefore it shouldn't throw an Exception there and then the BadSecureChannelIdInvalid seems kind of okay since that is what the server returns...

But understanding the problem from what happened without wireshark is really not that easy...

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:
- Environment:
- Runtime:
- Nuget Version:
- Component:
- Server:
- Client:

Anything else?

No response

KircMax commented 4 months ago

The logs show the Channel Socket closed and show that the SecureChannel has been closed and that afterwards the BeginSendRequst, Endpoints, Connecting -> HelloMessage, Opening and then OpenSecureChannel --> image

2024_0301-_16_4551-_OpcUA_SDK.log

KircMax commented 4 months ago

Just noticed that I created a duplicate of #2538 will close this one as duplicate soon and follow the other one.