how to keep wifly shield connected for sending or receiving buffer(client side)

how to keep wifly shield connected for sending or receiving buffer

I need it keep connect state with server and wait for sever sending data more than once

I had tested ,but it seen to only once it can receive from server ,then it can not receive anymore

unless close connect and re-connect again . but i don't want it re-connect!

but i don't want it re-connect!

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?

PaulS:

but i don't want it re-connect!

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

I want it stay online and wait command from server all the time.

A server can't push data to a client. Not if it is properly designed. The client should pull data whenever it needs it/is ready for it.

Something specific, instead of this handwaving, would be useful.

PaulS:

I want it stay online and wait command from server all the time.

A server can't push data to a client. Not if it is properly designed. The client should pull data whenever it needs it/is ready for it.

Something specific, instead of this handwaving, would be useful.

I aim to do clients control clients via server so I have to do this way . or any idea can provide me to improve this issue

I aim to do clients control clients via server

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?

but I afraid the checking period will cause reaction is not instantaneous

Nothing involving client/server processing and networking is instantaneous.

What are the clients, and what do they need other clients to do? It is time to get very specific.

PaulS:

but I afraid the checking period will cause reaction is not instantaneous

Nothing involving client/server processing and networking is instantaneous.

What are the clients, and what do they need other clients to do? It is time to get very specific.

those clients are remote controller and controllable light or door with wifi communication

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?

PaulS:

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.