Eoc

Checks whether a TCP connection has been closed by the peer.

Syntax
	KeyPgDeclareDeclare KeyPgFunctionFunction Eoc ( KeyPgByvalByVal filenum KeyPgAsAs KeyPgLongLong ) KeyPgAsAs KeyPgLongLong

Usage
	result = Eoc( filenum )

Parameters
	filenum
		A file number bound to an KeyPgOpenTcpOpen Tcp connection or an accepted TCP 
		client.

Return Value
	Returns true (-1) if the connection has ended, zero (0) otherwise.

Description
	Eoc means "end of connection".  It is intended for TCP file numbers, 
	where KeyPgEofEOF only says that no byte is immediately available to read.  A 
	TCP program can poll Eof to decide whether a read is ready and Eoc to 
	decide whether the remote endpoint has closed the socket.

	Calling Eoc on a non-TCP file number is an illegal function call.

Example
	See examples/network/opentcp/http-get.bas.

Differences from QB
	* New to FreeBASIC.

See also
	* KeyPgOpenTcpOpen Tcp
	* KeyPgTcpAcceptTcp Accept
	* KeyPgEofEOF

