title: recvfrom() returns sender port as 0 (zero)
body: <p>I have a simple UDP Server and Client. </p>
  
  <p>Client creates a DGRAM socket, binds it (explicitly) (even through it is not required), prints out the port it got bound to using getsockname() (non-zero) and then sends a message (via sendto()) which is successfully delivered.</p>
  
  <p>Server receives the message using recvfrom(). The message is received correctly but the port number in sender is zero FOR THE FIRST MESSAGE RECEIVED (I am using ntohs()). From the second message, the port number displays correctly (i.e. the same one which client shows it's socket got bound to).</p>
  
  <p>Any idea?</p>
  
  <p>UPDATE: Problem solved by me. See answer below.</p>