xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

INetRecvAll()

Reads all data from a socket.

Syntax

INetRecvAll( <pSocket>, @<cBuffer>, [<nBytes>] ) --> nBytesRead

Arguments

<pSocket>
This is a pointer to a socket as returned by INetConnect() or INetAccept().
<cBuffer>
A memory variable holding a character string must be passed by reference to INetRecvAll(). It must have at least <nBytes> characters.
<nBytes>
This is a numeric value specifying the number of bytes to transfer from the socket into the memory variable <cBuffer>. It defaults to Len(<cBuffer>).

Return

The function returns a numeric value indicating the number of bytes read from the socket. If the return value is smaller than Len(<cBuffer>), either no more bytes are available, or a network error ocurred. This can be identified using function INetErrorCode().

Description

Function INetRecvAll() does exactly the same a INetRecv(), but additionally blocks the current thread until the amount of <nBytes> is read from the socket, or the socket is prematurely closed.

Info

See also:INetAccept(), INetConnect(), INetErrorCode(), INetRecv(), INetRecvLine(), INetSend(), INetSendAll()
Category: Internet functions , Sockets functions , xHarbour extensions
Source:vm\INet.c
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe