The UDP server is having two IP addresses: one for the ethernet and the other for the wifi.
Now the UDP server is running on a single machine and listening on port 161 for SNMP query requests.
When I send request for SNMP query using ethernet IP address: the reply comes from ethernet address.
But when I send request for SNMP query using wifi IP address, again the reply come from the ethernet IP address only.
What I want is, when request is sent using wifi IP address(or for wifi Address), the reponse should come from the wifi IP address assigned to the server.
Now what I am trying to do is creating two Socket on the server, and listening on the port 161.
My doubt is whether we can bind two socket to the same port of the machine. Like here I am binding the port 161 with the two socket and trying to listen.
Or, if you can suggest any other way to do this, it will be appreciated.
Or, if the problem is not clear, please say.
Now the UDP server is running on a single machine and listening on port 161 for SNMP query requests.
When I send request for SNMP query using ethernet IP address: the reply comes from ethernet address.
But when I send request for SNMP query using wifi IP address, again the reply come from the ethernet IP address only.
What I want is, when request is sent using wifi IP address(or for wifi Address), the reponse should come from the wifi IP address assigned to the server.
Now what I am trying to do is creating two Socket on the server, and listening on the port 161.
My doubt is whether we can bind two socket to the same port of the machine. Like here I am binding the port 161 with the two socket and trying to listen.
Or, if you can suggest any other way to do this, it will be appreciated.
Or, if the problem is not clear, please say.