NetStreams SocketSelectHelper
 

See also object creation information - ClassID/ProgID 

Overview | Reference

Overview

The SocketSelectHelper is an optional object. Its usage can be completely skipped if you prefer working with flags and bit-wise operations over the status code returned by the SocketStream.Select method. However for scripter's convenience it provides a decoding functionality. The Select method and the returned state values are used mostly with non-blocking sockets, with blocking sockets (default behavior of the SocketStream if the Blocking property has not been set to False) this is rarely needed.

Typical usage pattern is:

Set NSMain = Server.CreateObject("newObjects.net.NSMain")
Set s = NSMain.NewSocket ' Somewhere in the code a socket stream has been created
' Some operations with it 
' .......
' At certain moment you need to query the socket state
Set so = NSMain.NewSelectHelper
' And here the object can be used to query the state easily - for example:
If so.ReadyWrite Then
  ' Do something - for example this may mean the server socket is 
  ' connected and you can send data now
Else
  ' Do something else - for example this may mean the socket is not yet
  ' ready for data transmission.
End If

Reference

Status Syntax:
v = object.Status
object.Status = v

Sets/Gets the raw integer value that holds the result flags from the Select operation

ReadyError Syntax:
v = object.ReadyError

Boolean value indicating if error state has been detected for the SocketStream object by the Select method

ReadyWrite Boolean value indicating if read ready state has been detected for the SocketStream object by the Select method
ReadyRead Boolean value indicating if write ready state has been detected for the SocketStream object by the Select method
newObjects Copyright 2001-2006 newObjects [ ]