Answer the question
In order to leave comments, you need to log in
How to organize client interaction directly in Java?
Hello!
Now I plan to write a small multi-user application in Java, for educational purposes. Actually, the idea of implementation is as follows:
Answer the question
In order to leave comments, you need to log in
The implementation itself requires only an understanding of the basics of network programming (socket, bind, listen, connect java.net.*). And the pitfall is huge. Clients, unlike servers, usually do not have globally routable addresses (white) or they are closed by a firewall. There are crutches like UPNP and NATPNP, but they don't always work. There is also the STUN technique (due to it, for example, torrent-utp works), but it will work less and less and does not work at all in mobile networks (as in other things, UPNP with NATPNP). With IPv6, a separate headache, because the address from which the client connected to the server may soon become invalid. A permanent address is better not to shine on the Internet without the permission of the user.
As a result, such an architecture can only work in local networks, since the modern Web does not like p2p very much.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question