accept() returning "0" zero (stdin fd) in c socket prog
<p>I am trying to create server which accepts multiple clients using c socket prog. but manytimes when client connects, <code>sockfd=accept()</code> returns 0 (zero) which is <code>stdin</code> fd. </p>

<p>As far as I know file descriptor returns minimum value which not in use, so it may returning 0 . But when I try to listen on sockfd (which is 0) or <code>send()</code> to <code>sockfd</code> it do nothing and both returns 0. </p>

<p>How can I overcome this?</p>

<p>I am working on RaspberryPi Raspbian (debian).</p>