UdpClient class
-
My chat application uses UdpClient class. It is working fine on LAN as well as over the internet. I can not recieve messages in one senerio, when I send message over the internet and the receiving party is indirectly connected to the internet like using a shared internet connection over LAN. How do I reach those clients? There is no server program and both parties are connected directly through IPs. Regards
-
My chat application uses UdpClient class. It is working fine on LAN as well as over the internet. I can not recieve messages in one senerio, when I send message over the internet and the receiving party is indirectly connected to the internet like using a shared internet connection over LAN. How do I reach those clients? There is no server program and both parties are connected directly through IPs. Regards
Your probably talking about the common situation where each machine is sitting behind a router/NAT/Firewall. In this case, your application doesn't do anything different. Each user must change the configuration of their NAT/Firewall to forward the port that your chat program is using to the machine's local IP address, usually on the 192.168.x.x network. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Your probably talking about the common situation where each machine is sitting behind a router/NAT/Firewall. In this case, your application doesn't do anything different. Each user must change the configuration of their NAT/Firewall to forward the port that your chat program is using to the machine's local IP address, usually on the 192.168.x.x network. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Thanks for the reply. Ok you got it right.. my client has a local IP address 192.168.x.x. How do I change the configuration of NAT to forward the port?? Regards
-
Your probably talking about the common situation where each machine is sitting behind a router/NAT/Firewall. In this case, your application doesn't do anything different. Each user must change the configuration of their NAT/Firewall to forward the port that your chat program is using to the machine's local IP address, usually on the 192.168.x.x network. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
One thing more... Udp being connectionless, the client at the other end is just sending messages to the public IP. How does it know that the message has to be forwarded to the 192.168.0.34 ?? There has be to some information at the sending end that the message is for 192.168.0.34 (local) on 205.166.6.33 (public IP) I am so confused :confused:
-
Thanks for the reply. Ok you got it right.. my client has a local IP address 192.168.x.x. How do I change the configuration of NAT to forward the port?? Regards
That's up to each individual router. You really can't do that in your code without writing a version for each manufacturer and different models of routers. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
One thing more... Udp being connectionless, the client at the other end is just sending messages to the public IP. How does it know that the message has to be forwarded to the 192.168.0.34 ?? There has be to some information at the sending end that the message is for 192.168.0.34 (local) on 205.166.6.33 (public IP) I am so confused :confused:
Your actually sending to a specific port at an IP address, not just to the IP address alone. The router has a table that tells it where to forward individual ports to local IP addresses. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Your probably talking about the common situation where each machine is sitting behind a router/NAT/Firewall. In this case, your application doesn't do anything different. Each user must change the configuration of their NAT/Firewall to forward the port that your chat program is using to the machine's local IP address, usually on the 192.168.x.x network. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Thanks Dave. The problem is now solved.. I configured the NAT settings.. ;)