• 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

chat client receiving 2 or more concurrent messages

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone. I'm facing a small problem. I created a simple text chat system, and the server is build in java. everything worked great until I started to test it with more clients.

So the idea is that one client can talk with multiple clients in the same time(similar to instant messaging software). The problem is when the client received 2 or more messages in the same time. it skips some of them.

On the server side I use a ThreadPoolExecutor to send the messages, every time it is required to send a message to a client I just create a runnable task and schedule it to the ThreadPool , but this way it is a possibility to send 2 messages in the same time to a certain client.

I think my problem can be solved by not sending more that one message in the same time to one client . SO I'm asking for some help, in case you can give me an idea of how to implement this using a threadpoolexecutor or if you have a better idea.

Thank you
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic