2

I have an SQL database and an ASP.NET website on the same machine. My question is, what is the difference between connection string that points to external IP (of the same machine) and connection string that points to localhost? Is one of them faster than the other?

1 Answer 1

3

Network traffic will not be different (neither will leave your computer) but using the localhost address is better because then you can have the DB server listen only on localhost (vs listening on the network address).

Sign up to request clarification or add additional context in comments.

3 Comments

So the "thing" is aware that the external IP is its own so it won't leave the computer?
I wonder what layer is the external IP determined to be locahost, OS?
Yes. Network stacks are not supposed to send packets out onto external interfaces if they're meant to be consumed locally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.