aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Need the explanation to a strange behaviour of programm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Need the explanation to a strange behaviour of programm" Watch "Need the explanation to a strange behaviour of programm" New topic
Author

Need the explanation to a strange behaviour of programm

Pavel Martynov
Greenhorn

Joined: Jul 23, 2012
Posts: 1
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:

 
Consider Paul's rocket mass heater.
 
subject: Need the explanation to a strange behaviour of programm