chat system I googled it a lot yet I couldn't come up with a solution, I mean how can two peers on the different network know each other without any kind of server, let's just think one peer is just connected to internet where should it search for other peers how could it get others address and from where??
You can build a p2p system that works on local network without requiring a centralised server. But if you want to do the same on internet scale, You'll have to get a centralised servers that tracks each and every user, Like a torrent tracker. To build this for a local network, Look into multicasting. Basically, You start a UDP server, Join a multicast group at some IP address(that belongs to multicast ip addr range) and a port. This way, Any instance of the app on the local network will be able to find each other. This method has limitations like, Router must have IGMP enabled. There are some situations which can result in a situation where two instances of an app can not find each other but I don't know much about those.
Обсуждают сегодня