xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

SetNetDelay()

Queries or changes the timeout period for Net*() functions.

Syntax

SetNetDelay( [<nNewTimeout>] ) --> nOldTimeout

Arguments

<nNewTimeout>
This optional numeric value specifies the timout period in seconds that must elapse before a Net*() function returns unsuccessfully. The default value is 30 seconds.

Return

The function returns the previous timeout period in seconds as a numeric value.

Description

SetNetDelay() queries and/or changes the current timeout period monitored by Net*() functions. When the requested database operation fails in multi-user access, it is automatically retried until the timeout period has elapsed.

Database operations that can fail in a network with multi-user access are opening a database file (see NetDbUse()) locking a database file (see NetFileLock()), locking a record (see NetRecLock()) or the creation of a new record in a database (see NetAppend()).

All Net*() functions monitoring a timeout period return immediately when the requested operation is successful. If the requested operation fails, it is retried once per second until either the timout period has elapsed or the operation is successfully retried.

The default timeout period is 30 seconds, which is by far sufficient for a database operation to complete in a network. For example, if a database record cannot be locked for write access with NetRecLock() because it is currently locked by another process, the function NetRecLock() tries 30 times to lock the current record until the default timeout period expires. If a record lock cannot be obtained within this period of time, the program logic concurrent database acces in a multi-user environment should be carefully reviewed.

Info

See also:NetAppend(), NetDbUse(), NetDelete(), NetFileLock(), NetRecall(), NetRecLock(), SetNetMsgColor()
Category: Database functions , Network functions , xHarbour extensions
Source:rtl\ttable.prg
LIB:xhb.lib
DLL:xhbdll.dll


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