title: Getting the socket FD from IP address and port
body: <p>Is their a way (except looping on all open FDs) to obtain the FD for a given <code>IP addr &amp; port</code>?
  I have a bunch of open UDP sockets each bound to an IP address &amp; port. The application, in some instances, acts as a forward application. Is their a <strong><code>getfdbyname</code></strong> system call?</p>
  
  <p>Specifically, my UDP application(C) sits between nodes A and B . </p>
  
  <p>1) A sends a message to C using <code>source Port 2000</code>, <code>destination port 3000</code> which is received by C</p>
  
  <p>2) C then has to forward this to <code>port 3000</code> of node B using port 2000.</p>
  
  <p>At step 1, the open socket bound to <code>port 3000</code> receives a message. However, at this point, I need to obtain the <code>FD</code> for the socket bound of <code>port 2000</code> to forward the message. </p>
  
  <p>Any ideas except looping over all configured sockets? </p>