Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent AggregateException when connecting to unity process #190

Merged
merged 2 commits into from Apr 26, 2023

Conversation

UlyssesWu
Copy link

@UlyssesWu UlyssesWu commented Apr 26, 2023

Link to issue(s) this pull request covers: #189

Problem

This should fix #189

Solution

Catch AggregateException, too.

dnError1

Comment on lines 435 to 439
catch (AggregateException aex) when (aex.InnerExceptions.All(ex => ex is SocketException {
SocketErrorCode: SocketError.ConnectionRefused
})) {
// Retry it in case it takes a while
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be better to check if InnerExceptions contains only one element which is the SocketException instead of testing every single one? Is it possible for InnerExceptions to contain more than one SocketException from the code inside the try?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's possible but if it really happens, this logic is still most likely correct and you don't have to fix it again. Anyway, I will change it if you insist.

@ElektroKill ElektroKill merged commit f676174 into dnSpyEx:master Apr 26, 2023
3 checks passed
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.

Add delay time option when debugging unity games
2 participants