(self, message, binary=False)
Broadcasts the given message to all registered
        websockets, at the time of the call.

        Broadcast may fail on a given registered peer
        but this is silent as it's not the method's
        purpose to handle websocket's failures.
Broadcasts the given message to all registered
        websockets, at the time of the call.
Broadcasts the given message to all registered websockets at the time of the call .
def broadcast(self, message, binary=False):
        """
        Broadcasts the given message to all registered
        websockets, at the time of the call.

        Broadcast may fail on a given registered peer
        but this is silent as it's not the method's
        purpose to handle websocket's failures.
        """
        with self.lock:
            websockets = self.websockets.copy()
            if py3k:
                ws_iter = iter(websockets.values())
            else:
                ws_iter = websockets.itervalues()

        for ws in ws_iter:
            if not ws.terminated:
                try:
                    ws.send(message, binary)
                except:
                    pass
def broadcast ( self , message , binary = False ) : with self . lock : websockets = self . websockets . copy ( ) if py3k : ws_iter = iter ( websockets . values ( ) ) else : ws_iter = websockets . itervalues ( ) for ws in ws_iter : if not ws . terminated : try : ws . send ( message , binary ) except : pass