Skip to content

Commit 731433a

Browse files
committed
Add Connect to Socket (#374)
(cherry picked from commit 5ac26e5)
1 parent 844b500 commit 731433a

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎nanoFramework.System.Net/Properties/AssemblyInfo.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
////////////////////////////////////////////////////////////////
1818
// update this whenever the native assembly signature changes //
19-
[assembly: AssemblyNativeVersion("100.20.0.0")]
19+
[assembly: AssemblyNativeVersion("100.20.0.1")]
2020
////////////////////////////////////////////////////////////////
2121

2222
// Setting ComVisible to false makes the types in this assembly not visible

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,15 @@ private EndPoint GetEndPoint(bool fLocal)
166166
public EndPoint RemoteEndPoint => GetEndPoint(false);
167167

168168
/// <summary>
169-
/// Gets or sets a value that specifies the amount of time after which a synchronous <see cref="Receive(byte[])"/> call will time out.
169+
/// Gets a value that indicates whether a <see cref="Socket"/> is connected to a remote host as of the last <see cref="Send"/> or <see cref="Receive"/> operation.
170+
/// </summary>
171+
/// <value>
172+
/// <see langword="true"/> if the <see cref="Socket"/> was connected to a remote resource as of the most recent operation; otherwise, <see langword="false"/>.
173+
/// </value>
174+
public bool Connected => _rightEndPoint != null && m_Handle != -1;
175+
176+
/// <summary>
177+
/// Gets or sets a value that specifies the amount of time after which a synchronous <see cref="Receive(Byte[])"/> call will time out.
170178
/// </summary>
171179
/// <value>
172180
/// The time-out value, in milliseconds. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period.

0 commit comments

Comments
 (0)