SocketTools .NET Edition

SocketWrench.Blocking Property

Gets and sets a value which indicates if the socket is in blocking mode.

[Visual Basic]
Public Property Blocking As Boolean
[C#]
public bool Blocking {get; set;}

Property Value

Returns true if the socket is in blocking mode; otherwise it returns false. The default value is true.

Remarks

Setting the Blocking property determines if socket operations complete synchronously or asynchronously. If set to true, then each socket operation (such as sending or receiving data) will return when the operation has completed or timed-out. If set to false, socket operations will return immediately. If the operation would result in the socket blocking (such as attempting to read data when no data has been sent by the remote host), an error is generated.

It is important to note that certain events, such as OnDisconnect, OnRead and OnWrite are only fired if the socket is in non-blocking mode.

See Also

SocketWrench Class | SocketTools Namespace