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 (neo-project#469)
  • Loading branch information
vncoelho authored and rodoufu committed Mar 3, 2019
1 parent ffcdf88 commit a066b1c
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 a066b1c

Please sign in to comment.