Example #1
0
 def __init__(self, port=9025, logfile=None, parser=None):
     self.port = port
     self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     self.file = None
     self.conn = None
     self.envelopes = []
     self.hostname = socket.gethostname()
     self._client = None
     self._callback = None
     self._reset()
     while 1:
         try:
             self.socket.bind(("", self.port))
             break
         except socket.error as msg:
             print("couldn't bind port",
                   self.port,
                   " - ",
                   msg,
                   "retrying...",
                   file=sys.stderr)
         scheduler.sleep(5)
     self.socket.listen(50)
     self.conversation = None
     self.logfile = logfile
     self.parser = parser
Example #2
0
 def __init__ (self, port=9025, logfile=None, parser=None):
     self.port = port
     self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     self.file = None
     self.conn = None
     self.envelopes = []
     self.hostname = socket.gethostname()
     self._client = None
     self._callback = None
     self._reset()
     while 1:
         try:
             self.socket.bind(("", self.port))
             break
         except socket.error as msg:
             print ("couldn't bind port",self.port," - ",msg,"retrying...", file=sys.stderr)
         scheduler.sleep(5)
     self.socket.listen(50)
     self.conversation = None
     self.logfile = logfile
     self.parser = parser
Example #3
0
def _get_hostname():
    global _HOSTNAME
    if _HOSTNAME is None:
        _HOSTNAME = socket.gethostname()
    return _HOSTNAME
Example #4
0
def _get_hostname():
    global _HOSTNAME
    if _HOSTNAME is None:
        _HOSTNAME = socket.gethostname()
    return _HOSTNAME
Example #5
0
 def hostname(self):
     """Returns the client hosts name."""
     return socket.gethostname()
Example #6
0
 def hostname(self):
     """Returns the client hosts name."""
     return socket.gethostname()