dashboard/moninj: use ephemeral UDP port

This commit is contained in:
Sebastien Bourdeauducq 2016-04-11 18:54:25 +08:00
parent a6c17d3e40
commit e7d448efd3
1 changed files with 1 additions and 1 deletions

View File

@ -263,7 +263,7 @@ class MonInj(TaskObject):
self.subscriber = Subscriber("devices", self.init_devices) self.subscriber = Subscriber("devices", self.init_devices)
self.dm = None self.dm = None
self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.socket.bind(("", 39284)) self.socket.bind(("", 0))
# Never ceasing to disappoint, asyncio has an issue about UDP # Never ceasing to disappoint, asyncio has an issue about UDP
# not being supported on Windows (ProactorEventLoop) open since 2014. # not being supported on Windows (ProactorEventLoop) open since 2014.
self.loop = asyncio.get_event_loop() self.loop = asyncio.get_event_loop()