C / determine port on which a packet was received
I have created four sockets with different port configurations. With the `select` function I read from one of the four file descriptors. But how can I find out on which port I received the UDP packet, I do only have the file descriptor, right? Depending on the port I need to process received packets differently. The `recv_from` function fills a `struct sockaddr` from which I can read out the source port of the packet, but not the destination port.

Thanks in advance for your help.
C / determine port on which a packet was received
===

I have created four sockets with different port configurations. With the `select` function I read from one of the four file descriptors. But how can I find out on which port I received the UDP packet, I do only have the file descriptor, right? Depending on the port I need to process received packets differently. The `recv_from` function fills a `struct sockaddr` from which I can read out the source port of the packet, but not the destination port.

Thanks in advance for your help.