Results 1 to 6 of 6

Thread: [RESOLVED] Network connection to local server

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2006
    Location
    Toronto, ON
    Posts
    1,093

    Resolved [RESOLVED] Network connection to local server

    A coworker and I are having a discussion and I'm wondering if anyone here knows the actual answer to it.

    Say you have a server called Server1 and you have a folder on it called C:\Folder1 which you've shared out. If you open windows explorer on Server1 and navigate to \\Server1\Folder1, I think that you go out to the network and then go back to the same server that you're on, so there's a network trip involved. My coworker thinks that the whole thing is local, so there's no difference between navigating to \\Server1\Folder1 and just going to C:\Folder1.

    Also, with databases, if you have a db on the machine and your connection string is ...<yadayada>DataSource=Server1, I think that it again involves a network trip in order to access the database, but the coworker thinks it's the same as using localhost.

    Anyone know which of these is correct?
    (VB/C#) is clearly superior to (C#/VB) because it (has/doesn't have) <insert trivial difference here>.

  2. #2
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Network connection to local server

    I would guess that it goes over the network, unless Windows checks if it's local or not.

    You can check this by downloading the free program WireShark and looking at the packets. If it shows the network packets then... well, it's going over the network.

  3. #3
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Network connection to local server

    I'm 99&#37; sure its local in the case of the shares, dunno about databases though.
    If you wanted an easier way to test it than using Wireshark, just share a folder on your PC, pull your network cable out and then try and access it via UNC path
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    May 2006
    Location
    Toronto, ON
    Posts
    1,093

    Re: Network connection to local server

    Quote Originally Posted by chris128 View Post
    I'm 99% sure its local in the case of the shares, dunno about databases though.
    If you wanted an easier way to test it than using Wireshark, just share a folder on your PC, pull your network cable out and then try and access it via UNC path
    Duh. This is such a pathetically simple way to test it that it astounds me that an entire group of IT people couldn't come up with it. Thanks for doing the basic thinking that we are clearly unable to do.

    ^^ That wasn't being sarcastic towards chris128, I'm just astonished that the whole lot of us never tried this and embarrassed that we needed someone to come up with it for us. Thanks for your help, chris128.

    It turns out that if you unplug the network cable, you can't access your local server through the network path. Interestingly enough, you can see the folders you've shared out (that information must be stored somewhere locally), but you can't open up any of those folders.
    (VB/C#) is clearly superior to (C#/VB) because it (has/doesn't have) <insert trivial difference here>.

  5. #5
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] Network connection to local server

    haha no worries I'm surprised it doesnt work with the network cable out... I could have sworn I've done that before. Just tested it though and you're right of course, and perhaps more surprisingly it wont even work when you use 127.0.0.1 to access the share. Learn something every day eh.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  6. #6
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] Network connection to local server

    Well I did a bit of digging and found that you can make this work by simply installing the loopback adapter (via the Add Hardware wizard in Control Panel). This basically just creates a virtual NIC and even if you just leave it set to use DHCP and it fails to get an IP address then the shares still work. So for example I can now do \\MyServer\ShareName even with the network cable unplugged... quite why you would want to do that I dont know but at least now we know its possible :P
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width