Skip to content

Commit c6a41c9

Browse files
authored
Clarify thread-safety of Socket.Connected (#4493)
* Clarify thread-safety of Socket.Connected * update wording
1 parent d3791c0 commit c6a41c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xml/System.Net.Sockets/Socket.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3845,7 +3845,7 @@ This method populates the <xref:System.Net.Sockets.Socket> instance with data ga
38453845
<format type="text/markdown"><![CDATA[
38463846

38473847
## Remarks
3848-
The `Connected` property gets the connection state of the <xref:System.Net.Sockets.Socket> as of the last I/O operation. When it returns `false`, the <xref:System.Net.Sockets.Socket> was either never connected, or is no longer connected.
3848+
The `Connected` property gets the connection state of the <xref:System.Net.Sockets.Socket> as of the last I/O operation. When it returns `false`, the <xref:System.Net.Sockets.Socket> was either never connected, or is no longer connected. `Connected` is not thread-safe; it may return `true` after an operation is aborted when the <xref:System.Net.Sockets.Socket> is disconnected from another thread.
38493849

38503850
The value of the <xref:System.Net.Sockets.Socket.Connected%2A> property reflects the state of the connection as of the most recent operation. If you need to determine the current state of the connection, make a nonblocking, zero-byte Send call. If the call returns successfully or throws a WAEWOULDBLOCK error code (10035), then the socket is still connected; otherwise, the socket is no longer connected.
38513851

0 commit comments

Comments
 (0)