aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes chat client receiving 2 or more concurrent messages Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "chat client receiving 2 or more concurrent messages" Watch "chat client receiving 2 or more concurrent messages" New topic
Author

chat client receiving 2 or more concurrent messages

Doua Beri
Ranch Hand

Joined: Sep 24, 2009
Posts: 60
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: chat client receiving 2 or more concurrent messages
 
Similar Threads
Problem with simple chat app
How to break blocked write operation???
Socket Programming [ Client / Server ]
Messenger/Chat program problem
Very Different Problem with JScrollPane