koodaamo/collective.websocketclient
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Introduction ============ Send test messages via the `@@websocketsend` view, using either GET or POST. Pass a single argument called `msg`, containing the message to be sent. Code usage example:: import socket from zope.component import getUtility from websocket._exceptions import WebSocketConnectionClosedException from .interfaces import IWebSocketConnectionManager manager = getUtility(IWebSocketConnectionManager) connection = manager.getConnection() if connection is None: print "could not connect!" else: try: connection.send(msg) print self.connection.receive() except (WebSocketConnectionClosedException, socket.error): # failed; if you want to retry, do so by first getting a new # connection, ie. call manager.getConnection() again print "failure!"
About
Configure, open & maintain a persistent websocket connection
Topics
Resources
Stars
Watchers
Forks
Packages 0
No packages published