added broadcasting of node/link messages to multiple session client scenarios
This commit is contained in:
parent
964fdd6793
commit
3ba7e3b1a3
1 changed files with 11 additions and 3 deletions
|
@ -536,12 +536,20 @@ class CoreRequestHandler(SocketServer.BaseRequestHandler):
|
||||||
message.queuedtimes = 0
|
message.queuedtimes = 0
|
||||||
self.queue_message(message)
|
self.queue_message(message)
|
||||||
|
|
||||||
|
# delay is required for brief connections, allow session joining
|
||||||
if message.message_type == MessageTypes.SESSION.value:
|
if message.message_type == MessageTypes.SESSION.value:
|
||||||
# delay is required for brief connections, allow session joining
|
|
||||||
time.sleep(0.125)
|
time.sleep(0.125)
|
||||||
|
|
||||||
# TODO: do we really want to broadcast node and link messages from a client to other clients?
|
# broadcast node/link messages to other connected clients
|
||||||
# self.session.broadcast(self, message)
|
if message.message_type not in [MessageTypes.NODE.value, MessageTypes.LINK.value]:
|
||||||
|
continue
|
||||||
|
|
||||||
|
for client in self.session.broker.session_clients:
|
||||||
|
if client == self:
|
||||||
|
continue
|
||||||
|
|
||||||
|
logger.info("BROADCAST TO OTHER CLIENT: %s", client)
|
||||||
|
client.sendall(message.raw_message)
|
||||||
|
|
||||||
def handle_node_message(self, message):
|
def handle_node_message(self, message):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue