Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i need to make communication between two computers.
one is in internet one machine is in lan.

internet machine can't access the lan machine directory.
but lan machine can able to access that internet machine,

Is any possibility is there to share the udp pkts between these two machines.
Posted

This depends on how your LAN is connected to the internet. When the router that connects your LAN to the internet uses NAT (Network Address Translation), you must setup port forwarding for incoming packets on your router. This requires also that the computer on the internet knows the public (internet side) IP address of your router. If this may change (like with most dial-up and non-commercial connections), you must also use a dynamic DNS service.

If this is for a company, ask the network administrator. Otherwise, see the documentation of your router and read about Port Forwarding and dynamic DNS if necessary.

In general this is more a networking topic than a programming one.
 
Share this answer
 
If both of machines knows the IP address of each other I would use TCP/IP protocol rather then UDP. UDP is just a kind of broadcasting:
 (Documentation)
UDP is connectionless protocol. When you a send a data or message, you don't know if it'll get there, it could get lost on the way. There may be corruption while transferring a message.

In other case (the IPs are not known) you can try it with UDP. Take a look at this example for start with it:

http://www.abc.se/~m6695/udp.html
 
Share this answer
 
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900