Determines the status of the System.Net.Sockets.Socket.
- time_us
- Documentation for this section has not yet been entered.
- mode
- One of the System.Net.Sockets.SelectMode values.
The status of the System.Net.Sockets.Socket based on the polling mode value passed in the mode parameter.
SelectMode.SelectRead true if Socket.Listen(int) has been called and a connection is pending;
-or-
true if data is available for reading;
-or-
true if the connection has been closed, reset, or terminated;
otherwise, returns false.
SelectMode.SelectWrite true, if processing a Socket.Connect(System.Net.EndPoint), and the connection has succeeded;
-or-
true if data can be sent;
otherwise, returns false.
SelectMode.SelectError true if processing a Socket.Connect(System.Net.EndPoint) that does not block, and the connection has failed;
-or-
true if SocketOptionName.OutOfBandInline is not set and out-of-band data is available;
otherwise, returns false.
Type Reason NotSupportedException mode is not one of the values defined in the System.Net.Sockets.SelectMode enumeration. System.Net.Sockets.SocketException An error occurred while accessing the socket.
Note: For additional information on causes of the SocketException, see the System.Net.Sockets.SocketException class.ObjectDisposedException The current instance has been disposed.
The Socket.Poll(int, SelectMode) method will check the state of the System.Net.Sockets.Socket. Specify SelectMode.SelectRead for the selectMode parameter to determine if the System.Net.Sockets.Socket is readable. Specify SelectMode.SelectWrite to determine if the System.Net.Sockets.Socket is writable. Use SelectMode.SelectError to detect an error condition. Socket.Poll(int, SelectMode) will block execution until the specified time period, measured in microseconds, elapses. Set the microSeconds parameter to a negative integer if you would like to wait indefinitely for a response. If you want to check the status of multiple sockets, you might prefer to use the Socket.Select(IList, IList, IList, int) method.
If you receive a System.Net.Sockets.SocketException, use the SocketException.ErrorCode property to obtain the specific error code. After you have obtained this code, refer to the Windows Sockets version 2 API error code documentation in the MSDN library for a detailed description of the error.
This method cannot detect certain kinds of connection problems, such as a broken network cable, or that the remote host was shut down ungracefully. You must attempt to send or receive data to detect these kinds of errors.
This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].