• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server and Multiclient application

 
Amruta Jegarkal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use Threads and put every communication with client in another thread.
 
Amruta Jegarkal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10277
60
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Amruta Jegarkal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10277
60
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic