check for data on a socket
valid open socket ID
By default, a read operation on a socket will block until data becomes available. The procedure Peek enables you to test for the presence of data on a socket. This is useful for avoiding the use of timeouts on calls to Sockets[Read], Sockets[ReadLine], or Sockets[ReadBinary].
The procedure Peek never blocks; either the value false or a string is returned immediately.
When Peek is called, it "samples" the data available on the socket without reading it. A string containing the data "sample" is returned. The same data will be available to the next call to Sockets[Read], Sockets[ReadLine], or Sockets[ReadBinary]. If no data is available on the socket, then the value false is returned.
sid ≔ Open⁡localhost,echo:
Download Help Document