文件创建后在远程系统上不可用。 Windows 网络延迟?
我有一个 ASP.NET Web 应用程序。当它需要在远程系统上生成文件时,它会(通过 tcp/ip)调用创建该文件的同一台计算机上的进程。它在网络共享上创建它。当该进程完成写出文件后,它会将“OK”响应发送回我的 asp.net 应用程序。我相信您知道事情的发展方向。当 asp.net 应用程序检查文件是否存在(使用 File.Exists())时,有时可能需要长达 8 秒的时间才能“找到”该文件。是否有某种目录信息在 Windows 网络上被缓存?是按进程计算的吗?
总之,一个进程创建该文件,另一进程最多需要 8 秒才能看到该文件。我怎样才能克服这个问题?再次强调,这是标准的 Windows 网络。 Server 2008 到 Server 2008。
通过实验获得一些更新:在桌面上运行的另一个程序可以比 asp.net 应用程序更快地看到该文件。差异可能是 7-10 秒。为什么 ASP.NET iis 服务需要这么长时间才能查看远程文件?
谢谢, 布莱恩
I have an asp.net web application. When it needs to produce a file on a remote system, it makes a call (over tcp/ip) to a process on the same machine that creates the file. It creates it on a network share. When that process is finished writing out the file, it sends an "OK" response back to my asp.net application. I'm sure you see where this is headed. When the asp.net application checks if the file exists (using File.Exists()), it can sometimes take as long as 8 seconds for it to be "found". Could there be some kind of directory info being cached across windows networking? And would it be per processs?
In summary, one process creates the file, and it takes up to 8 seconds before the other process can see it. How can I overcome this? Again, this is standard windows netorking. Server 2008 to server 2008.
Have some updates from experimenting: Another program running on the desktop can see the file a lot sooner than the asp.net application can. The difference can be 7-10 seconds. Why would the ASP.NET iis service take so long to see the remote file?
Thanks,
Brian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该共享可能是 DFS 共享吗?如果答案是肯定的,那么它就在那里,但仅在一台计算机上,当您第二次连接到该共享时,您可能会连接到另一台还没有该文件的计算机,因为它仍在复制。
Is the share perhaps a DFS share? If the answer is yes, then it is there, but only on one machine, and the second time you connect to that share you may be connecting to another machine that does not have the file yet, as it is still replicating.