Skip to content

prevent AggregateException when connecting to unity process#190

Merged
ElektroKill merged 2 commits intodnSpyEx:masterfrom
UlyssesWu:fix_unity_debug
Apr 26, 2023
Merged

prevent AggregateException when connecting to unity process#190
ElektroKill merged 2 commits intodnSpyEx:masterfrom
UlyssesWu:fix_unity_debug

Conversation

@UlyssesWu
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
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