<<

Contents

Search

>>

 

SERVER_SOCKET_READ$

 

 

Function

 

 

Syntax:

SERVER_SOCKET_READ$(<Handle of Server Socket>,<Number of Characters>)

 

<Handle of Server Socket>

= <NUM-EXPRESSION>

<Number of Characters>

= <NUM-EXPRESSION>

 

 

Meaning:

Reads data from a connected client and returns the read data as string.

 

If <Number of Characters> > 0, exactly <Number of Characters> characters are read. The function is only terminated when <Count> characters could be read.

 

If <Number of Characters> = 0, one line is read, that means the function continues reading until an end of file character is received. The function is is only terminated when a line could be read.

 

If <Number of Characters> = -1, the number of characters is returned which can be read.

 

If an error occurs (e.g. timeout), the variable ERRORTEXT$ contains the error report. If no error occurred, the variable  ERRORTEXT$ contains the the empty string "".

 

Parameter:

Handle of Server Socket

Handle which has been returned by SERVER_SOCKET.

Number of Characters

Number of characters to be read

 

Sample:

DATA$ = SERVER_SOCKET_READ$(HANDLE%,0)

IF NOT ISSPACE(ERRORTEXT$)
THEN … Error …

ENDIF

 

See also:

SERVER_SOCKET

SERVER_SOCKET_SET_TIMEOUT

SERVER_SOCKET_WRITE

SERVER_SOCKET_GET_CLIENT_ADDRESS$

CLOSE_SOCKET

CLIENT_SOCKET