Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C udp
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 19-Feb-13 22:58pm
Rate this: bad
good
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.
  Permalink  
Rate this: bad
good
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:
 (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
  Permalink  
v5

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

  Print Answers RSS
0 OriginalGriff 358
1 Sergey Alexandrovich Kryukov 239
2 MT_ 175
3 Yogesh Kumar Tyagi 165
4 ChauhanAjay 156
0 Sergey Alexandrovich Kryukov 6,205
1 OriginalGriff 5,333
2 CPallini 2,473
3 Richard MacCutchan 1,617
4 Abhinav S 1,530


Advertise | Privacy | Mobile
Web01 | 2.8.140814.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2014
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