hb_inetRecv()

HB_INETRECV()

Read from a socket

Syntax

      HB_INETRECV( <socket>, @<cResult>, [ <nAmount> ] ) -> nResult

Arguments

<socket> a socket previously created / opened

<cResult> is the target buffer and must be passed by reference

<nAmount> is the upper limit of characters to be read from the socket. If not passed this defaults to the length of cResult

Returns

The number of the characters read from the socket.

Description

Reads from the socket into a buffer.

The parameter cString must be preallocated so that it has enough space to receive the data. The routine will block the thread until some bytes are read from the socket, the socket is closed (either from the receiver or the sender side) or a network error occurs, whichever comes first. In the latter cases, an error is set, and only the characters received until premature end of communications are returned.

Notice that there is no guarantee that all the available bytes will be read before the function returns, in fact, hb_InetRecv returns as soon it is able to fill cString with one or more bytes. To block the current process until the whole cString is filled (or nAmount bytes are read), use the hb_InetRecvALL().

Compliance

Harbour

Advertisements

3 responses to “hb_inetRecv()

  1. Pingback: Harbour All Functions – H | Viva Clipper !

  2. Pingback: Harbour inet Functions | Viva Clipper !

  3. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s