Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Server and Multiclient application

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.......
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:














 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic