What is file-descriptor?
<p>While trying to learn socket programming, I saw the following code:</p>
<pre><code>int sock;
sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
</code></pre>
<p>I browsed through the man page and found that socket returns a file descriptor. I have tried searching the internet and other similar questions here but I couldn't understand what file descriptor really is. That would be great if someone could explain file descriptor in easy language.</p>