lontivero/Open.NAT

Search Task bug

haikushisui opened this issue · 1 comments

hi

I found a non expected error in Searcher.cs.
The Search method hung because of the receive function around line 110
var buffer = client.Receive(ref receivedFrom);

This cause the async Search method to never end meaning no devices will be returned by the DiscoverAsync method.

I went ahead and add a try catch in Search method like that

try
{
     Discover(cancelationToken);
     Receive(cancelationToken);
}
catch (Exception e)
{
}

Hope it can help

hi

Sorry for the double post
Just to precise I did the changes locally
I didn't throw a pull request because this is a quick fix I'm sure you guys will come up with a better solution

take care