• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

With windows 2000 is there a way to accsess local unc path locally

I have an application (written in csharp 2005)  that reads files stored in different folder. For all of these folders, I access them via a UNC path. Many of these folders are local to the machine (ex \\machine\folder is C:\folder). I noticed that even when I am accessing a local path since I am accessing it via an unc name, it creates network traffic and therefore is slower and subject to network problems. Can I tell the OS to treat local UNC path as local or is there a programmatic way I can do it with .NET?
0
SSAFECS
Asked:
SSAFECS
  • 3
  • 3
1 Solution
 
arnoldCommented:
Why not programatically check on which system the application is running and then use either the UNC path or a local path.  Additional checks can be added i.e. if a specific file exists in a local path to confirm you are on the right system and not on a system that was similarly named.

It is puzzling that you are looking for a programmatic approach to modify/alter the OS/.Net framework instead of introducing some additional logic to your application to handle this.

You effectively want to alter the .NET method to check whether the UNC path represents a local system.  Then translate the UNC path to its local  equivalent and then use the direct fileobject method rather than the network method to access your files.

0
 
SSAFECSAuthor Commented:
arnold:
Thanx for your comment I can modify the software on the next release but that will not be for a couple of months. We are currently experiencing network problems in our production environment and I was wondering if there is something I can do now to temporarily fix the problem. Perhaps via the hosts file

As an aside I was wondering if there was a programmatic way of doing it.



0
 
arnoldCommented:
I do not think so.  The fileobject method which I presume what you use to access the resource, switches functionality based on what is provided \\ means share requiring network related handling while the c:\ requires a different type of processing.

One thing you can try on the local system is to add
127.0.0.1 servername
in c:\windows\system32\drivers\etc\hosts  This will try to access the share resource via the local loopback interface.

Since you need this functionality for a single system, not sure how difficult it would be to add a check prior to calling the fileobject command;
Am I on servername? True path='c:\folder':FALSE path='\\servername\folder'


0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
SSAFECSAuthor Commented:
Arnold:
Again thank you for your help I tried adding the server name to the c:\windows\system32\drivers\etc\hosts  as you suggested. Now we have 2 servers on the LAN machine name aa7 and machine name aa6. I was working on machine name aa7. However I added both aa6 and aa7 to the etc\hosts file and redirected them both to 127.0.0.1. Then I cycled the DNS Client service. When I ping aa6 from aa7 I now get a reply from 127.0.0.1 as I would expect. However when I ping aa7, the machine I am on to itself, I get a reply from the IP of the machine not the localhost?!
0
 
arnoldCommented:
You have two systems with the same name on the network, or do you have a DNS record that points to two IPs which represent two different server names?

Well then, the server when accessing itself does not consult the hosts file.
Are you loadbalancing the share either through DFS or DNS?

I still think the modification to the application is the quickest solution.  You know where the problem is, yet you are dancing around the issue trying to find an alternate more complex solution.
Are there people looking into the network issue?

Do you SNMP poll the system's network interfaces on the servers using an app like cacti (www.cacti.net)?
Even though the application has added overhead because of the tcp overhead, network issues should not affect the perfomance unless the amount of data that is flowing in/out from/to external sources pounds this server (saturates its NIC).
0
 
SSAFECSAuthor Commented:
We don't have 2 systems with the same nameone system is named aa7 and one is named aa6 :) . We are fixing the issue in the code now. Again i was just hoping there was a temporary solution we could put in place
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now