Mono Class Library: System.Net.Sockets.Socket Overview | Members

System.Net.Sockets.Socket.Poll Method

Determines the read, write, or error status of the current instance.

public bool Poll (int time_us, SelectMode mode)

Parameters

time_us
Documentation for this section has not yet been entered.
mode
One of the values defined in the System.Net.Sockets.SelectMode enumeration.

Returns

A bool where true indicates the current instance satisfies at least one of the conditions in the following table corresponding to the specified System.Net.Sockets.SelectMode value; otherwise, false. false is returned if the status of the current instance cannot be determined within the time specified by microSeconds .

SelectMode value Condition
SelectRead

Data is available for reading (includes out-of-band data if the SocketOptionName.OutOfBandInline value defined in the System.Net.Sockets.SocketOptionName enumeration is set).

-or-

The socket is in the listening state with a pending connection, and the Socket.Accept method has been called and is guaranteed to succeed without blocking.

-or-

The connection has been closed, reset, or terminated.

SelectWrite

Data can be sent.

-or-

A non-blocking Socket.Connect(System.Net.EndPoint) method is being processed and the connection has succeeded.

SelectError

The SocketOptionName.OutOfBandInline value defined in the System.Net.Sockets.SocketOptionName enumeration is not set and out-of-band data is available.

-or-

A non-blocking Socket.Connect(System.Net.EndPoint) method is being processed and the connection has failed.

Exceptions

TypeReason
NotSupportedExceptionmode 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.

ObjectDisposedExceptionThe current instance has been disposed.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0