Configuring the All Networks Driver (aka NPP) for OpenInsight (Network Compatibility)
Created at 22 JAN 1997 01:07PM
New Information!
The Revelation NPP version 1.4 limits the number of file handles allocated to 24, avoiding the problems discussed in this document. To keep the previousbehaviour, set the following in the OINSIGHT.INI file:
[LinearHash]
DosFileHandlesMax=AUTO
The All Networks (NPP) Driver is optimized to work with a large number of LH files simultaneously. As part of this optimization, the NPP Driver can utilize a substantial number of file handles to avoid repeated opening and closing of files. To avoid hoarding file handles, and possibly adversely affecting other applications, the NPP Driver queries the operating system for the number of available file handles and then limits itself to some fraction of those handles.
Revelation Software has identified a problem, however, with the allocation of file handles for the NPP driver. The first part of the problem is that the Windows operating environment returns the incorrect number of available file handles. The NPP driver has a secondary check which verifies that there are indeed that many file handles available, but here again, the operating environment can provide misleading results. As a result, the NPP driver can exhaust the available file handles, causing unpredictable problems when other applications, including other parts of the OpenInsight application, try to access operating system files.
To solve this problem, the maximum number of files that the NPP uses can be set on a per-workstation basis. To set the maximum number of files to 25, for example, the following section must be added to the OINSIGHT.INI file (located in each workstation's Windows directory):
[LinearHash]
DosFileHandlesMax=25
If your site has experienced problems using the NPP driver in OpenInsight, Revelation Software suggests that you apply the above changes to each workstation. The following example shows how this can be accomplished in an OpenInsight application:
1. Determine the startup window for the application. This window is typically the "main" window for the application, and quite often is an MDI frame.
2. Add the following code to the Create event for the window:
declare subroutine GetPrivateProfileString, WritePrivateProfileString, Msg, Post_Event
$insert Logical
$insert Msg_Equates
equ INI_FILE$ to "OINSIGHT.INI": \00\
equ INI_SECTION$ to "LinearHash": \00\
equ INI_ENTRY$ to "DosFileHandlesMax": \00\
* define the minimum, maximum, and default number of files
* (you can change these values to suit your needs)
equ MIN_FILES$ to 16
equ MAX_FILES$ to 128
equ DFT_FILES$ to 32
* get the maximum number of file handles that the NPP will use
Buf = str(\00\, 16)
GetPrivateProfileString(INI_SECTION$, INI_ENTRY$, \00\, Buf, len(Buf), INI_FILE$)
Max = Buf [1,\00\]
* check to see if the maximum number of file handles is enough
Valid = FALSE$
if (len(Max) and num(Max)) then
if Max >= MIN_FILES$ and Max ⇐ MAX_FILES$ then
Valid = TRUE$
end
end
* if the maximum number of files is invalid, update the INI
if not(Valid) then
WritePrivateProfileString(INI_SECTION$, INI_ENTRY$, DFT_FILES$: \00\, INI_FILE$)
Text = "Your configuration has been modified."
Text := " The change will not take affect until this application is restarted."
Text := "||Would you like to close the application now?"
Rec = ""
Rec<MTEXT$ > = Text
Rec<MTYPE$ > = "BNY"
Rec<MDEFBTN$ > = 1
Rec<MICON$ > = "!"
Rec<MCAPTION$> = "Close Application"
if Msg(@window, Rec) = RET_YES$ then
Send_Event(@window, "CLOSE")
end
end
return 0
The above source may not be formatted correctly in a web browser; the properly formatted source appears below in text format (NotePad).
Note: This document should be used as an addendum to the documentation which is included with the NPP product. A subset of that documentation appears below in Windows Write format and in text format (NotePad).
{{kb0077_2.png}} {{kb0077_3.png}}