• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need the explanation to a strange behaviour of programm

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

reply
    Bookmark Topic Watch Topic
  • New Topic