Re: How to Waiting simultaneously for client connections and Central
server outputs
Armando wrote:
now is my design wrong? is there any better design for it?
The issue is that a problem statement isn't a design.
It's also incomplete. What do you do after you connect anyway? What
kind messages do you process? What about disconnects? User
authentication? Error logging? A zillion other possibilities.
I wait for
your solution.
Not likely. Do your own damn homework.
keep in mind that SS is Server and at the same time is
Client. Do I split SS class in two class: SServer and Sclient? at this
time I didn't have any idea but if you have I will be happy to know
your idea.
This is implementation. Design first. I'd like to see some use cases.
The start a class and package breakdown. Since you are into multiple
threads here, you'll have to detail how the threads should interact. At
that point I think you'll have something closer to an implementable design.
So far for a use case, all I see is this
Client -- connects to server
Server -- accepts client connection
What the heck happens next is totally opaque to me.