xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

INetSetTimeout()

Sets a timout value in milliseconds for a socket.

Syntax

INetSetTimeout( <pSocket>, <nMilliSeconds> ) --> NIL

Arguments

<pSocket>
This is a pointer to a socket created from any socket creation function.
<nMilliSeconds>
A numeric value specifies the timeout period in milliseconds.

Return

The return value is always NIL.

Description

INetSetTimeout() sets the timeout value for a socket, after which a blocking sockets function returns. If the blocking sockets function is not completed withing the timeout period, it returns, and a sockets error of -1 is set.

Refer to function INetSetPeriodCallback() for an example of taking advantage of a timeout value.

Note:  high-level sockets functions, like INetRecvAll(), internally call their low-level counterpart INetRecv() multiple times until all data is retrieved. The timeout value is applied to all individual INetRecv() calls, not for the entire INetRecvAll() call.

Info

See also:INetClearPeriodCallback(), INetClearTimeout(), INetCreate(), INetSetPeriodCallback()
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