Navigation:  ThinBASIC Modules > TcpUdp (Networking) > TCP functions >

TCP_Eof

Previous pageReturn to chapter overviewNext page

Description

 

Detect that an incomplete line was received when working with TCP_lineInput function.

 

Syntax

 

n = TCP_Eof(nFile)

 

Returns

 

Number.

 

Parameters

 

Name

Type

Optional

Meaning

nFile

Number

No

Previously opened file number

 

Remarks

 

This function may be used with TCP_LineInput function to detect that an incomplete line was received.  Normally, these statements read data until a $CRLF character pair is found, and in that case, TCP_Eof will return 0 (FALSE).  However, even if no $CRLF has been found, the statements will end when no additional data is available.  In that case, they will return whatever data has already been accumulated, and set EOF to -1 (TRUE).

 

In many cases, it would be prudent to test TCP_Eof after every TCP_LineInput to verify that a full line has been received.  In some cases, you may wish to execute the statement one or more additional times, combining the data, in order to obtain a full line of text.

 

Restrictions

 

See also

 

Examples