2

In the page http://pypi.python.org/pypi/websocket-client/0.4 the first snippet (the "Low Level API example") is very much like the client example in http://docs.python.org/library/socket.html#example.

What I'm interested in is if is there any possibility of making a TCP client that is even driven, like the "JavaScript websocket-like API example" on that first webpage, that executes actions when for an example a message arrives. How can I achieve this ? I found this example that uses twisted. Any other (better ?) ways to do it ?

João Pinto Jerónimo
  • 9,586
  • 15
  • 62
  • 86

1 Answers1

1

Take a look at Tornado and specifically at tornado.iostream — Convenient wrappers for non-blocking sockets.

Maxim Egorushkin
  • 131,725
  • 17
  • 180
  • 271