Socket.Poll Method
Determines the read/write status of the current socket for a specified polling mode.
Namespace: System.Net.Sockets
Assembly: System (in system.dll)
Syntax
public bool Poll (
int microSeconds,
SelectMode mode
)
Parameters
- microSeconds
The amount of time, in microseconds, that you want the application to wait for a response. Set this parameter to a negative integer if you want the application to wait indefinitely for a response. - mode
A value of the SelectMode enumeration that specifies the polling mode whose read/write status you want to retrieve.
Return Value
The return values for the various polling modes are listed in the following table.
Polling mode | Return value |
---|---|
SlectRead | true if:
|
SlectWrite | true if:
|
SlectError | true if:
|
Remarks
The Poll method will check the read/write state of the socket. Specify SelectMode.SelectRead for the mode parameter to determine whether the socket is readable. Specify the SelectMode.SelectWrite mode to determine whether the socket is writable. Use the SelectMode.SelectError mode to detect an error condition.
The Poll method returns when the time period specified by the microSeconds parameter elapses. Note that Poll blocks execution of other methods until it returns.
Version Information
Available in .NET Micro Framework version 2.0, 2.5