Click here to Skip to main content
13,003,516 members (57,831 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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 19-Feb-13 22:58pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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:
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:

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170626.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100