Skip to content

Handle exceptions during receive and dispose timer#24

Open
Nuklon wants to merge 3 commits into
jpmikkers:netcorefrom
Nuklon:patch-2
Open

Handle exceptions during receive and dispose timer#24
Nuklon wants to merge 3 commits into
jpmikkers:netcorefrom
Nuklon:patch-2

Conversation

@Nuklon
Copy link
Copy Markdown

@Nuklon Nuklon commented Feb 28, 2024

Exceptions weren't handled properly, causing them to appear in UnobservedTaskException.
Also the Timer created during MainTask wasn't disposed. I've split this up in two methods to greatly simplify the logic.

@jpmikkers
Copy link
Copy Markdown
Owner

Hi, I agree the OperationCanceledException should be handled of course (I've been working on asyncifying TFTPServer and ran into the same issue). But there's a good reason to have just one thread/maintask: this ensures I don't need locking for state updates of the dhcp server. I'll have a go at merging the fixes I applied to TFTPServer into DHCPServer, that should do the trick.

Address feedback.
@Nuklon
Copy link
Copy Markdown
Author

Nuklon commented Feb 28, 2024

Ah, yes, I see. The problem is that with WhenAny one task remains running in the background and never catched properly. I think it makes sense to add some trivial synchronization here, I've added another commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants