Skip to content

Commit

Permalink
Catch exception on UPNP that cause socket problem when reconnecting a…
Browse files Browse the repository at this point in the history
…fter network fail (#469)
  • Loading branch information
vncoelho authored and erikzhang committed Dec 4, 2018
1 parent addb31e commit d0f80cc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions neo/Network/UPnP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ public static bool Discover()

DateTime start = DateTime.Now;

s.SendTo(data, ipe);
s.SendTo(data, ipe);
s.SendTo(data, ipe);
try
{
s.SendTo(data, ipe);
s.SendTo(data, ipe);
s.SendTo(data, ipe);
}
catch
{
return false;
}

byte[] buffer = new byte[0x1000];

Expand Down

0 comments on commit d0f80cc

Please sign in to comment.