Ejemplo n.º 1
0
 def _formatinfo(self):
     if hasattr(self, 'socket'):
         try:
             fileno = self.socket.fileno()
         except Exception:
             ex = sys.exc_info()[1]
             fileno = str(ex)
         result = 'fileno=%s ' % fileno
     else:
         result = ''
     try:
         if isinstance(self.address, tuple) and len(self.address) == 2:
             result += 'address=%s:%s' % self.address
         else:
             result += 'address=%s' % (self.address, )
     except Exception:
         ex = sys.exc_info()[1]
         result += str(ex) or '<error>'
     try:
         handle = getfuncname(self.__dict__['handle'])
     except Exception:
         handle = None
     if handle is not None:
         result += ' handle=' + handle
     return result
Ejemplo n.º 2
0
 def _formatinfo(self):
     if hasattr(self, 'socket'):
         try:
             fileno = self.socket.fileno()
         except Exception:
             ex = sys.exc_info()[1]
             fileno = str(ex)
         result = 'fileno=%s ' % fileno
     else:
         result = ''
     try:
         if isinstance(self.address, tuple) and len(self.address) == 2:
             result += 'address=%s:%s' % self.address
         else:
             result += 'address=%s' % (self.address, )
     except Exception:
         ex = sys.exc_info()[1]
         result += str(ex) or '<error>'
     try:
         handle = getfuncname(self.__dict__['handle'])
     except Exception:
         handle = None
     if handle is not None:
         result += ' handle=' + handle
     return result
 def _formatinfo(self):
     if hasattr(self, "socket"):
         try:
             fileno = self.socket.fileno()
         except Exception:
             ex = sys.exc_info()[1]
             fileno = str(ex)
         result = "fileno=%s " % fileno
     else:
         result = ""
     try:
         if isinstance(self.address, tuple) and len(self.address) == 2:
             result += "address=%s:%s" % self.address
         else:
             result += "address=%s" % (self.address,)
     except Exception:
         ex = sys.exc_info()[1]
         result += str(ex) or "<error>"
     try:
         handle = getfuncname(self.__dict__["handle"])
     except Exception:
         handle = None
     if handle is not None:
         result += " handle=" + handle
     return result
            try:
                fileno = self.socket.fileno()
            except Exception, ex:
                fileno = str(ex)
            result = 'fileno=%s ' % fileno
        else:
            result = ''
        try:
            if isinstance(self.address, tuple) and len(self.address) == 2:
                result += 'address=%s:%s' % self.address
            else:
                result += 'address=%s' % (self.address, )
        except Exception, ex:
            result += str(ex) or '<error>'
        try:
            handle = getfuncname(self.__dict__['handle'])
        except Exception:
            handle = None
        if handle is not None:
            result += ' handle=' + handle
        return result

    @property
    def server_host(self):
        """IP address that the server is bound to (string)."""
        if isinstance(self.address, tuple):
            return self.address[0]

    @property
    def server_port(self):
        """Port that the server is bound to (an integer)."""
Ejemplo n.º 5
0
    def _formatinfo(self):
        if hasattr(self, 'socket'):
            try:
                fileno = self.socket.fileno()
            except Exception, ex:
                fileno = str(ex)
            result = 'fileno=%s ' % fileno
        else:
            result = ''
        try:
            result += 'address=%s:%s' % self.address
        except Exception, ex:
            result += str(ex) or '<error>'
        try:
            handle = getfuncname(self.__dict__['handle'])
        except Exception:
            handle = None
        if handle is not None:
            result += ' handle=' + handle
        return result

    @property
    def server_host(self):
        """IP address that the server is bound to (string)."""
        return self.address[0]

    @property
    def server_port(self):
        """Port that the server is bound to (an integer)."""
        return self.address[1]