Skip to content

Commit

Permalink
Merge pull request #2 from JSGInray/JSGInray-patch-2
Browse files Browse the repository at this point in the history
Apply fix from ume05rw#39
  • Loading branch information
BoBiene authored May 15, 2024
2 parents 8a9c219 + 203d05c commit 7d35e36
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions SharpCifs.SMBv1/Smb/SmbTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,19 @@ public virtual void Connect()
}
catch (TransportException te)
{
var local = (IPEndPoint)this.Socket?.LocalEndPoint;
var remote = (IPEndPoint)this.Socket?.RemoteEndPoint;

IPEndPoint local = null;
IPEndPoint remote = null;

try
{
local = (IPEndPoint)this.Socket?.LocalEndPoint;
remote = (IPEndPoint)this.Socket?.RemoteEndPoint;
}
catch (SocketException)
{

}

// IO Exception
throw new SmbException($"Failed to connect, {Address} [ {local?.Address}:{local?.Port} --> {remote?.Address}:{remote?.Port} ]", te);
}
Expand Down

0 comments on commit 7d35e36

Please sign in to comment.