fixed issue where the udp handler would no broadcast node/link changes from coresendmsg

This commit is contained in:
Blake Harnden 2020-04-02 21:14:08 -07:00
parent 7be7beec42
commit d0c4d4b935

View file

@ -50,6 +50,8 @@ class CoreHandler(socketserver.BaseRequestHandler):
The CoreHandler class uses the RequestHandler class for servicing requests.
"""
session_clients = {}
def __init__(self, request, client_address, server):
"""
Create a CoreRequestHandler instance.
@ -87,7 +89,6 @@ class CoreHandler(socketserver.BaseRequestHandler):
thread.start()
self.session = None
self.session_clients = {}
self.coreemu = server.coreemu
utils.close_onexec(request.fileno())
socketserver.BaseRequestHandler.__init__(self, request, client_address, server)
@ -1972,6 +1973,7 @@ class CoreUdpHandler(CoreHandler):
}
self.session = None
self.coreemu = server.mainserver.coreemu
self.tcp_handler = server.RequestHandlerClass
socketserver.BaseRequestHandler.__init__(self, request, client_address, server)
def setup(self):
@ -2060,7 +2062,7 @@ class CoreUdpHandler(CoreHandler):
if not isinstance(message, (coreapi.CoreNodeMessage, coreapi.CoreLinkMessage)):
return
clients = self.session_clients[self.session.id]
clients = self.tcp_handler.session_clients[self.session.id]
for client in clients:
try:
client.sendall(message.raw_message)