Tcp Accept

Accepts a connection from an Open Tcp Server file number.

Syntax
	KeyPgDeclareDeclare KeyPgFunctionFunction Tcp Accept ( [#]serverfilenum KeyPgAsAs KeyPgLongLong ) KeyPgAsAs KeyPgLongLong

Usage
	clientfilenum = Tcp Accept( [#]serverfilenum )

Parameters
	serverfilenum
		A file number previously opened with KeyPgOpenTcpServerOpen Tcp Server.

Return Value
	Returns a new client file number on success, or zero (0) on failure.

Description
	Tcp Accept waits for the next incoming connection on a TCP server file 
	number.  It chooses a free file number for the accepted client and 
	returns it to the program.  The returned file number should be closed 
	with KeyPgCloseClose when the connection is no longer needed.

	The server file number remains open and may be passed to Tcp Accept 
	again to accept another connection.

Example
	See examples/network/opentcp/http-server.bas and 
	examples/network/opentcp/two-connections-selftest.bas.

Differences from QB
	* New to FreeBASIC.

See also
	* KeyPgOpenTcpServerOpen Tcp Server
	* KeyPgOpenTcpOpen Tcp
	* KeyPgEocEoc
	* KeyPgFreefileFreeFile

