hb_inetTimeout()

HB_INETTIMEOUT()

Get or change the timeout value of a socket

Syntax

      HB_INETTIMEOUT( <socket> [, <nTimeout> ] ) -> nPreviousTimeout

Arguments

<socket> a socket previously created / opened

<nTimeout> is the new socket timeout value

Returns

Returns the previous timeout value of the socket

Description

Sets or changes the timeout value of the socket.

Compliance

Harbour

hb_inetTimeLimit()

HB_INETTIMELIMIT()

Get or change the time limit value of a socket

Syntax

      HB_INETTIMELIMIT( <socket> [, <nTimeLimit> ) -> NIL

Arguments

<socket> a socket previously created / opened

<nTimeLimit>

Returns

Returns the previous time limit value of the socket

Description

Sets or changes the time limit value of the socket.

Compliance

Harbour

hb_inetStatus()

HB_INETSTATUS()

Get the status of a socket

Syntax

      HB_INETSTATUS( <socket> ) -> nResult

Arguments

<socket> a socket previously created / opened

Returns

Returns 1 (one) if the socket exists, -1 if it does not

Compliance

Harbour

hb_inetSetSndBufSize()

HB_INETSETSNDBUFSIZE()

Set the send buffer size of a socket

Syntax

      HB_INETSETSNDBUFSIZE( <socket>, <nSize> ) -> nSize

Arguments

<socket> a socket previously created / opened

nSize

Returns

Returns the passed nSize or -1 on error

Description

Sets the send buffer size of a socket

Compliance

Harbour

hb_inetSetRcvBufSize()

HB_INETSETRCVBUFSIZE()

Set the receive buffer size of a socket

Syntax

      HB_INETSETRCVBUFSIZE( <socket>, nSize ) -> nSize

Arguments

<socket> a socket previously created / opened

nSize

Returns

Returns the passed nSize or -1 on error

Description

Sets the receive buffer size of a socket

Compliance

Harbour

hb_inetServer()

HB_INETSERVER()

Create a socket bound to a port

Syntax

      HB_INETSERVER( <port> [, <cBindAddr> [, <nListenLimit> ]]  ) -> SOCKET

Arguments

<port>

<cBindAddr>

<nListenLimit> is an internal parameter and rarely needs to be passed, defaults to 10

Returns

An INET socket

Description

Creates a server that can accept connections from client on a certain port.

If the computer on which hb_InetServer is called has more than one logical interface (e.g. one network card, one loopback and one PPP address), cBindAddr can be specified to select only one of these interfaces to accept connections for this process. This is useful when a server is present on two networks, and the service is to be available only in one of them. Also, the same port on other addresses is left free to be used, so you can have different server programs running for different networks but managing the same service. For example, an FTP server available to the internal network could be radically different from an FTP server available for the internet.

nListenLimit is the number of incoming connections accepted by kernel before the kernel has the chance to report them to the application program. If the sockets receive nListenLimit connections before accepting them all, the nListenLimit + 1 connection will be notified to be “busy” by the kernel. The default value of 10 is enough for even a heavy duty server.

On error, sets error description in the newly returned socket.

Compliance

Harbour

hb_inetSendAll()

HB_INETSENDALL()

Send data through a socket with blocking

Syntax

      HB_INETSENDALL( <socket>, <cBuffer> [, <nLength> ] ) 
                       -> nResult

Arguments

<socket> a socket previously created / opened

<cBuffer>

<nLength>

Returns

The amount of data written, 0 (zero) if the socket is closed, or -1 on an error

Description

This function works exactly as hb_InetSend() but it ensures that all the data to be sent is written before returning.

Compliance

Harbour