aspose file tools*
The moose likes Beginning Java and the fly likes Server and Multiclient application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Server and Multiclient application" Watch "Server and Multiclient application" New topic
Author

Server and Multiclient application

Amruta Jegarkal
Greenhorn

Joined: Nov 29, 2012
Posts: 29
Im working on Server and Multiclient application.....when server prints any line on client;control is not coming back to server unless client enters any data so how to make control to come back to server so that it can print next statement for client.......
Lukasz Jarocki
Greenhorn

Joined: Jan 01, 2013
Posts: 10
You need to use Threads and put every communication with client in another thread.
Amruta Jegarkal
Greenhorn

Joined: Nov 29, 2012
Posts: 29
Lukasz Jarocki wrote:You need to use Threads and put every communication with client in another thread.

Can you please explain me more precise how to implement as im not clear.....
Lukasz Jarocki
Greenhorn

Joined: Jan 01, 2013
Posts: 10
Well, show some effort, nobody won't write whole code. Just show which part of implemantation is difficult for you.

Basicaly all you need to do (on server side) is:
- create server socket and bind it
- wait for connection (accept method)
- then handle every new connection in new thread:
Amruta Jegarkal
Greenhorn

Joined: Nov 29, 2012
Posts: 29
Lukasz Jarocki wrote:Well, show some effort, nobody won't write whole code. Just show which part of implemantation is difficult for you.

Basicaly all you need to do (on server side) is:
- create server socket and bind it
- wait for connection (accept method)
- then handle every new connection in new thread:




I already did this much:














Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7029
    
  16

Amruta Jegarkal wrote:I already did this much...

Just for future reference, that's a heck of a lot of information to leave out.

Now...what was your question again? Have you run this? Does it compile? If you've run it, does it produce an error?

We're really floundering in the dark until you tell us what your specific problem is.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Artlicles by Winston can be found here
Amruta Jegarkal
Greenhorn

Joined: Nov 29, 2012
Posts: 29
Winston Gutkowski wrote:
Amruta Jegarkal wrote:I already did this much...

Just for future reference, that's a heck of a lot of information to leave out.

Now...what was your question again? Have you run this? Does it compile? If you've run it, does it produce an error?

We're really floundering in the dark until you tell us what your specific problem is.

Winston

This code is working fine,my question is when server sends something to client;until client reply server cannot send anything.....So i want client and sever to be independent in sending message.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7029
    
  16

Amruta Jegarkal wrote:This code is working fine,my question is when server sends something to client;until client reply server cannot send anything.....So i want client and sever to be independent in sending message.

In which case, you probably want to look at something like JMS, which supports asynchronous messaging; but I'd make certain you're sure about the rules before you do so. Do you really want your server bashing out messages into the ether if there's no likelihood of them ever being read?

Winston
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server and Multiclient application
 
Similar Threads
Difference b/w application server and webserver
live website chat application!
reentrant???
networking and threading!
Server and Multiclient application