SOCKET PEEK()

From Lianjapedia
Jump to: navigation, search

Purpose

Function to check if there is data available on an open socket connection

Syntax

SOCKET_PEEK(<expN>)

See Also

ACLASS(), ADDPROPERTY(), AMEMBERS(), COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, DISPLAY CLASSES, DODEFAULT(), FOREACH, JSON_DECODE_FILE(), JSON_ENCODE(), LIST CLASSES, LOADOBJECT(), NEWOBJECT(), OBJECT(), PRINT_JSON(), PRINT_HTML(), PRINT_R(), PRINT_XML(), REMOVEPROPERTY(), REQUIRE_ONCE(), SAVEOBJECT(), SELECT, SOCKET_CLOSE(), SOCKET_LASTERROR(), SOCKET_OPEN(), SOCKET_READ(), SOCKET_SERVER(), SOCKET_WRITE(), WITH, XML_DECODE_FILE()

Description

The SOCKET_PEEK() function is used to check if there is data available on an open socket connection. The <expN> is the socket number returned from SOCKET_OPEN() or SOCKET_SERVER().

Example

// check the socket connection
if socket_peek(skt) > 0 
    // we have some data to read...
endif