posted 11 years ago
I have done the example chat from "Head First Java" book. For those who don't know - it's a simple programm, where you have a client and a server part, through client you can send a message and server will send it to all clients that connected to him. But because I have a dynamic IP i decided to make a little change, so I added a window where you cant input the ip of server. And that's where the bag appeared, which I tried to understand for the past two days without a result. What you do: launch server and client, then go File - ip config - save(don't change localhost ip) then send any message and you will receive two message instead of one. But if you do previous operations multiply times(File - ipconfig - save 3-4 five times or more) and then will send one message, you will still receive two(no more no less). Please help me, this is driving my crazy, here is the code:
Server part: