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