• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Need the explanation to a strange behaviour of programm

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:

Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic