opcua icon indicating copy to clipboard operation
opcua copied to clipboard

Prevent hanging on TCP connections that won't return [any/full] OPC UA data

Open jb0n opened this issue 3 years ago • 2 comments

Great lib! I was using it to look at some interesting OPC UA servers I found on the internet (scanning for them truth be told) and ran into situations where io.ReadFull hangs forever. I made some changes and allowed the Dialer to have a read timeout it can pass to connections.

jb0n avatar Jan 15 '23 22:01 jb0n

I've rebased your changes onto main, squashed them and also added support for write timeouts. I've also cleared the deadline after the read/write. Not sure if this is necessary. Could you please review and test this change?

@kung-foo it would be great if you could have a look at this as well.

I've tagged this for v0.4 since this may have some wider implications.

magiconair avatar Mar 23 '23 11:03 magiconair

Hey thanks for the reply. I had a few things I was going to take out of that CR, I'll do that as well as implement your suggestion.

On Wed, Mar 22, 2023 at 6:53 AM Frank Schröder @.***> wrote:

@.**** requested changes on this pull request.

Thank you. Can you just use a time.Duration and check if it is greater than zero instead of using a pointer? Then I'll merge it.

— Reply to this email directly, view it on GitHub https://github.com/gopcua/opcua/pull/628#pullrequestreview-1352639806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALDTPYEHWZJ7FE6LKLTTWDW5L76NANCNFSM6AAAAAAT4DARHE . You are receiving this because you authored the thread.Message ID: @.***>

jb0n avatar Mar 24 '23 19:03 jb0n