aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Server sending data to Clients Randomly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Server sending data to Clients Randomly" Watch "Server sending data to Clients Randomly" New topic
Author

Server sending data to Clients Randomly

V. Garg
Greenhorn

Joined: Jun 04, 2009
Posts: 22
I have designed a multi client chat structure. Previously also I have made several posts regarding this same program All those issues were solved but the post had grown too long and was looking very complicated thus I have decided to start a new post. This is also having a newer kind of issue.

Please help me overcome the problem

I am trying to send data to each client from the server. It is accepting all the clients.
The problem which is soming is as follows.

1. The server is reading the keystroke and is printing on its interface and after then sending to the client. it should print the key in sequential order. But here it is not doing this task in sequential order. If I try to print 1-10, then it will not print all 10 values in sequence.

2. This is main problem which I am unable to overcome. The text send by server should be recieved by all the clients. All the clients recieve the text but the problem is, the clients are running in Thread and at a time only a single Thread recieve text and not all. All the text is recieved by the cloients but all clients don't recieve all texts. some text is recieve by some client and other text is recieved by other client

The code which I have written is as follows


"Server.java"



" Client.java "



V. Garg
Greenhorn

Joined: Jun 04, 2009
Posts: 22
I am not sure in which part the problem is, That could be either in the server's sending part or could be in the client's Recieving part.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server sending data to Clients Randomly