Solved

fopen and _lopen delay when opening a network file after a 15 minute idle period

Posted on 2004-09-17
4
323 Views
Last Modified: 2013-12-03
Our application needs to open files across a network, using fopen and _lopen calls.  Normally this is not a problem, but at our most recent installation site, we are experiencing a 6 second delay when executing an fopen or _lopen call to a network file.  Subsequent calls made immediately to fopen and _lopen execute without a delay, however if we wait for 15 minutes, the 6 second delay re-appears.

Other than this issue, normal networking functions at this site are within acceptable limits.

We are using Windows XP on the client workstation, and Windows 2000 on the file server.

An example of our call is:

fopen("\\192.168.1.100\bwclass\151\test.fil","rb");
0
Comment
Question by:johnjbarryjr
  • 2
4 Comments
 
LVL 8

Expert Comment

by:mxjijo
ID: 12089327

I guess you need to narrow down the problem.

You should find out

1) Where exactly the delay happens
    a) Winthin requesting machine ?
    b) Network ?
    c) Machine at the other end

There could ne several reasons causing it. Network delay, disk usage etc.

I think you should run a few tools to figure this out.

Let me call the requesting machine as the client and the other machine server.

1) Run FileMon.exe (sysinternals.com) and a packet sniffer (ethereal.exe or similar) on the client side and find out if the there is a delay between the API call and the request packet being placed on the network.

2) At the same time run TDIMon.exe (sysinternals.com) on the serverside and find out if there is a network delay.

3) Again, Run FileMon.exe at the server side and see if there is a delay in disk access and/or sending the data back

Sounds a little messy, but without knowing which side causing the delay its hard to fix it.

Since you have 6 sec delay, you can easily observe the delay.
I would say start with Filemon.exe running on both sides and you can roughly see where the delay is.



0
 
LVL 86

Expert Comment

by:jkr
ID: 12091716
I assume this is a problem regarding the caching of credentials on the server. After 15min idle, the clients' CRTs need to re-aithenticate aain, causing that delay.
0
 

Author Comment

by:johnjbarryjr
ID: 12101903
jkr:  If this is the case, is there anyway to speed this up, or keep it from timing out?
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 12102660
Hum, the easiest way (without fiddling with any registry or protocol settings) might be to issue an 'stat()' call in maybe 5min intervals to keep the connection "alive".
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question