Good day!
I need to write a program that implements a direct global connection between two computers. I found and worked quite a lot of articles and code on the Internet, and for a start I stopped at the implementation, like here http://www.quizful.net/post/java-socket-programming . It works perfectly on lockalhost and if you set your target IP as your own, programmatically obtained like this - http://cloud-notes.blogspot.ru/2012/05/java-ip.html , but only if it is local, and the connection between two different computers, or their own, but no longer passes through the global IP. Suspicions of NAT have fallen - but between two computers isolated from each other with direct access to the Internet, (as determined by this https://ru.wikibooks.org/wiki/Network_port/What_Single_NAT_and_how_determine , _find_li_my_for_NAT articles) also failed. The proxy is not used, (looked here http://www.lagado.com/proxy-test ) the firewall is disabled on both machines. Tested many times, and in the global network, and in the local (router), but without success. I read somewhere that most of the providers give out dynamic IPs, which is why they do not connect using pre-specified ones, but this does not solve the problem by which computers on the local network do not connect. Revised all previous questions on (oddly enough) StackOverflow, but did not find a specific solution, despite several identical problems.
I would be very grateful if: (any of the following)
- Prompt the possible causes and their circumvention ( absolutely all assumptions are suitable)
- They will give a code / link to a code with a ready-made implementation that takes into account this problem.
- Prompt alternative mechanism of simple direct connection between two remote / local computers by Java
Used: Java 1.8.0_101 under the platform of Windows 7, and the Yota modem, either directly or through Asus router. Firewall and antivirus are disabled during testing.