I have get really confused in IP types with sockets (empty string, 'local host', etc...)
<p>Im using python.
I dont understand the purpose of empty string in IP to connect to if its not to connect between two Computers in the same LAN router.</p>

<p>My knowledge in network is close to zero, so when I reading in the internet somthing like this:</p>

<blockquote>
  <p>empty string represents INADDR_ANY, and the string ''
  represents INADDR_BROADCAST</p>
</blockquote>

<p>So if you please will be able to explain me, like you explain to a baby that dont know nothing - what is the purpose of any of the follows in the IP location in socket object:</p>

<blockquote>
  <p>broadcast</p>
  
  <p>''</p>
  
  <p>localhost</p>
</blockquote>

<p>and if there is more, so I will be glad to know about them too. Tanks.</p>

<p><code>'localhost'</code> (or <code>'127.0.0.1'</code>) is use to connect with program on the same computer - ie. database viewer &lt;-> local database server, Doom client &lt;-> local Doom server. This way you don't have to write different method to connect to local server. </p>

<p>Computer can have more then one network card (NIC) and every NIC has own IP address. You can use this IP and program will use only this one NIC to receive request/connection. This way you can have server which receive request only from LAN but not from Internet - very popular for databases used by web servers.</p>

<p>Empty string means <code>'0.0.0.0'</code> which means that program will receive request from all NICs.</p>

python sockets