Is it possible to write a simple python script which handles real-time server pushin开发者_JS百科g of data back to the client when data is available?
"Yes, but":
You can keep the connection between the client and server live; but this can take significantly more server resources.
Edit: If you want to do this, see
- Python Comet Server
- How to implement Comet server side with Python?
- The latest recommendation for Comet in Python?
You can have the client register an IP address which the server can contact, but you will run into a huge amount of trouble with client-side firewalls.
Or you can just do what most services do, and have the client poll the server occasionally.
精彩评论