But, that is the nature of client/server communications. Make a request. Get a response. Make a request. Get a response.
What are you trying to do?
I want it stay online and wait command from server all the time.
wifly shield must be client ,because I create a server on system to deal with multiple client
So, a client ("Tom") says to the server "Make Mike stand on his head", and the server is supposed to figure out which client is Mike, and send it the command to stand on it's head?
Client connections are not persistent.
I think you need to rethink your architecture. Each client should poll the server as often as needed, to see if there is anything for it to do. The server just maintains a list of things some client has asked that another client do. When a client named in the lists asks what to do, the server pops the first item in the list for that client, and returns it.
PaulS:
So, a client ("Tom") says to the server "Make Mike stand on his head", and the server is supposed to figure out which client is Mike, and send it the command to stand on it's head?
Client connections are not persistent.
I think you need to rethink your architecture. Each client should poll the server as often as needed, to see if there is anything for it to do. The server just maintains a list of things some client has asked that another client do. When a client named in the lists asks what to do, the server pops the first item in the list for that client, and returns it.
you mean every client check whether have message from server ,if yes then act ? but I afraid the checking period will cause reaction is not instantaneous
another idea , I use udp protocol instead of tcp ,in this case ,it just broadcast in local network and do not need nature of request or response , this idea can work on wifly shield?
those clients are remote controller and controllable light or door with wifi communication
You plan on having a wifi shield at each door or light? Why does a light need to send commands to a door?
I mean the remote controller can control both of door and light ,those of them communication via server
I had tried single remote controller control single object ,now I want to try multiple remote controller control multiple object .So I involve sever to deal those of them
simply ,just like a chat room , every body say anything in the chat room ,among of them can receive the message they want and react.