Network handler for UDP port allocation and server network interfaces.

This commit is contained in:
Jeremy
2015-01-24 15:32:58 -07:00
parent c002bbfb23
commit 50fea669b5
9 changed files with 134 additions and 63 deletions

View File

@ -51,6 +51,21 @@ class PortManager:
else:
self._console_host = host
assert not hasattr(PortManager, "_instance")
PortManager._instance = self
@classmethod
def instance(cls):
"""
Singleton to return only one instance of PortManager.
:returns: instance of PortManager
"""
if not hasattr(cls, "_instance") or cls._instance is None:
cls._instance = cls()
return cls._instance
@property
def console_host(self):