Skip to content

Commit 645bf95

Browse files
martin-kuhnjosesimoes
authored andcommitted
Fix return value of GetEndpoint() (#110)
1 parent 9a255b8 commit 645bf95

File tree

1 file changed

+2
-4
lines changed
  • source/nanoFramework.System.Net/Sockets

1 file changed

+2
-4
lines changed

source/nanoFramework.System.Net/Sockets/Socket.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class Socket : IDisposable
1919
* The m_Handle field MUST be the first field in the Socket class; it is expected by
2020
* the SPOT.NET.SocketNative class.
2121
*/
22-
// [FieldNoReflection]
22+
// [FieldNoReflection]
2323
internal int m_Handle = -1;
2424

2525
[Diagnostics.DebuggerBrowsable(Diagnostics.DebuggerBrowsableState.Never)]
@@ -116,8 +116,6 @@ private EndPoint GetEndPoint(bool fLocal)
116116
throw new ObjectDisposedException();
117117
}
118118

119-
EndPoint ep = null;
120-
121119
if (m_localEndPoint == null)
122120
{
123121
m_localEndPoint = new IPEndPoint(IPAddress.Any, 0);
@@ -139,7 +137,7 @@ private EndPoint GetEndPoint(bool fLocal)
139137
m_localEndPoint = endPoint;
140138
}
141139

142-
return ep;
140+
return endPoint;
143141
}
144142

145143
/// <summary>

0 commit comments

Comments
 (0)