title: Where are socket FDs are stored?
body: <p>I faced few issues while writing server application using TCP on linux system. I have few queries.</p>
  
  <ol>
  <li>Where are socket FDs are stored and what are the attributes associated with socket FDs. </li>
  <li>How the kernel differentiates between FDs like socket FDs, file Fds, Message Queue FDs</li>
  </ol>
  
  <p>Socket FDs are received as</p>
  
  <pre><code>int sockFD = socket(..., ..., ...);
  </code></pre>
  
  <p>what is the difference between<br>
  a) <code>close(sockFD);</code><br>
  and<br>
  b) <code>int sockCopy = sockFD; //copy the socketfd</code><br>
  &nbsp;&nbsp;&nbsp;&nbsp;<code>close(sockCopy);</code></p>
  
  <p>Case b will not close socket why?</p>