I am trying to learn about p2p networks by making a simple chatapp and I searched someways of node discovery and decided to try to make some kind of central server that peers can discover each other from I noticed a weird issue when doing that when I send a command "get_peers" the server sometimes responds to the client that actually sent that command and sometimes sends it to another client which didn't even send anything I tried debugging to see and I saw that sometimes when I send from one client it actually thinks it has got it from another client which is very odd to me at this point. I am still a beginner though I am not sure if I am doing this the correct way I am not following something just playing around also the code doesn't need to make alot of sense to u I just need help to fix this bug and would like to hear if I that way of node discovery is actually effective or should I find something else ?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.