Hi
I have a chat program using System.Net.Sockets.Socket that works perfectly over LAN.
My question is - will this same program work over the net with little or no modification and if so do i provide the client with the IP of my machine or of my router and use port forwarding ?
My IP is NOT static (i do understand the implications of this)
thanks
It should work identically, as long as you can get a connection through. there is technically no difference between lan communication and internet communication (one is just huge and complex)
Related
I am doing a multiplayer game using UDP protocol (DatagramSocket and DatagramPacket). The program has to do client and server at the same time. This works fine on LAN networks, but I would like to make it work on Internet too. I have tried to use hamachi, but it doesn't work, the information goes only in one direction.
EDIT: Ok, I ask in another way. Is there any java class, program or anything else to connect two computers on internet using java?
Ok, I have just resolved the problem. It works fine with hamachi. I was copying wrong IP's, so it didn't work. If you exchange your IP's to each other, It works.
How can i make a p2p chat in vb.net communicate with my friends PC at their house from my own.
i have made a LAN Chat which was fairly simple, but i really cannot figure out how to get it to connect to his pc using a public ip.
I Assume that port forwarding would be a factor in this but Im trying to make it so that port forwarding is not required to be done so the user (my friend) does not have to porforward.
The Program is comprised of text-boxes threads and the Transmission Control Protocol for the listeners/server
please help thank you very much, sorry if my English appalls you. :D
All Fixed, It Was Port Forwarding Which Was Needed To Be Done,no need to Post on This Any More
For the past two week I have been unsuccessfully trying to implement udp hole punching, but I'm not sure why. I understand that the algorithm for hole punching is not guaranteed to work, but I believe it should work in my test case because I have noticed that once I bind my socket on my home-network, the port is the same to the outside world as it is locally, and stays that way for all connections made from this socket. Any help after reviewing my trials would be appreciated.
I have three computers, my osx desktop, my iPhone, and my amazon ec2 ami.
on the desktop I've built a cocoa app which uses the GCDAsyncUDPSocket library to bind a port and contact the ec2 server, where a java app using apache's mina library stores the sockets external ip/port and associates it with a username passed in the payload.
the iphone, which is on the AT&T network runs an app which uses the same GCDAsyncUDPSocket library to contact the ec2 server with the same username, which then the ec2 does a lookup for the username, finds the desktops info and informs the desktop of the iphones address and the iphone of the desktops address.
now the iphone & the desktop know about each other they start shooting off packets at each other in hopes to get a punched hole.
in theory this should work, but maybe I am missing something about mobile networks that would make this difficult? But then again running a simple udp echoer on a 4th external computer to manually msg the desktop did not work either, so maybe its my router, but I don't see how that could be as all my tests show that the port the desktop asks for is the same one assigned by the router.
I've been at this for nearly two weeks with little progress and any tips would be appreciated!
"once I bind my socket on my home-network, the port is the same to the outside world as it is locally"
I highly doubt that. To traverse NAT given peers A and B which have sent datagrams to a 3rd party: S you need to send datagrams from A to B and vice versa using their public IPs as seen by S and their port as seen by S (i.e. not the port A, B are bound to from their point of view).
I don't know if anybody have issued this, but I wan't to ask. My problem was like this:
I could use video chatting from apprtc.appspot.com using two Chrome tab (which means I call myself). Everything worked well.
I could use apprtc with two different laptop as well, if those laptop were on the same network. I used my university's network behind proxy.
However, apprtc didn't work if I used it with one laptop on modem, and the other on LAN.
Can anybody explain what happened? Is this STUN/ICE problem? Or JSEP?
The public demo includes a STUN server but does not provide a TURN sever because the bandwidth to run a free TURN server is expensive. STUN get thought lots but not all NATs / firewalls but not anywhere near as many as TURN. You might be in a situation where TURN would work (but you don't have a TURN server) but STUN does not.
I've been able to use the demo at http://apprtc.appspot.com/ from behind two different NAT's. So it can at least work in theory; but it's also fairly well known that STUN, TURN and ICE aren't infallible. For starters, if someone has blocked access to the port 19302 (the port of the STUN server that the apprtc demo uses), the firewall traversal will never be able to get started.
The basic troubleshooting step would be to open up the Chrome developer tools (ctrl-shift-i) and look to see if there are any errors in the console. Failing to observe anything interesting there, you'd need to write up your own version of the demo app, this time with better error handling. For instance, the apprtc demo assumes certain things that can't really be taken for granted, for instance, that peerConnection.setLocalDescripton() and peerConnection.setRemoteDescription() will succeed. In production code, you'd really need to implement both success and failure callbacks on those - and that would give you better information about what might be going wrong.
AppRTC uses stun by default. TURN is 'better' (from my understanding), but I recall Justin Uberti saying public TURN servers will likely be misused (or something to that effect).
STUN often fails on enterprise grade subnets because it can't 'cope' with unfriendly NAT addressing.
I'm currently using cocoahttpserver to do some file sharing thing in my iPhone app. Does anyone know how to use public IP address to connect to the phone, that is to use the Internet, rather than internal connection via WiFi.
Any help would be appreciated! Thanks in advance.
Some thoughts on running an HTTP server on an iPhone:
Most of the time, with IPv4 addresses, the IP address is what is known as a “NAT” address. Simply put, the address it uses can only be accessed from other computers on the same network. It usually can not be accessed from the internet at large.
IPs can can be accessed from the internet at large cost quite a bit of money to have. They do not exist for wireless 3G networks.
Web servers like Apache and lighthttpd compile and run fine on an iPhone. However, the iPhone needs to be jailbroken before running these servers (but there appears to be a web server app for the iPhone)
Apache needs text files to be edited to be configured. It’s a great web server, but people who want to use it better be comfortable reading documentation and editing text files by hand.