Ejemplo n.º 1
0
 def get_connections(self, kind='inet'):
     """Return etwork connections opened by a process as a list of
     namedtuples.
     """
     if kind not in conn_tmap:
         raise ValueError("invalid %r kind argument; choose between %s" %
                          (kind, ', '.join([repr(x) for x in conn_tmap])))
     families, types = conn_tmap[kind]
     ret = _psutil_bsd.get_process_connections(self.pid, families, types)
     return [nt_connection(*conn) for conn in ret]
Ejemplo n.º 2
0
 def get_connections(self, kind='inet'):
     """Return etwork connections opened by a process as a list of
     namedtuples.
     """
     if kind not in conn_tmap:
         raise ValueError("invalid %r kind argument; choose between %s"
                          % (kind, ', '.join([repr(x) for x in conn_tmap])))
     families, types = conn_tmap[kind]
     ret = _psutil_bsd.get_process_connections(self.pid, families, types)
     return [nt_connection(*conn) for conn in ret]
Ejemplo n.º 3
0
 def get_connections(self, kind='inet'):
     """Return etwork connections opened by a process as a list of
     namedtuples.
     """
     if kind not in conn_tmap:
         raise ValueError("invalid %r kind argument; choose between %s"
                          % (kind, ', '.join([repr(x) for x in conn_tmap])))
     families, types = conn_tmap[kind]
     rawlist = _psutil_bsd.get_process_connections(self.pid, families, types)
     ret = []
     for item in rawlist:
         fd, fam, type, laddr, raddr, status = item
         status = _conn_status_map[status]
         nt = nt_connection(fd, fam, type, laddr, raddr, status)
         ret.append(nt)
     return ret
Ejemplo n.º 4
0
 def get_connections(self, kind='inet'):
     """Return etwork connections opened by a process as a list of
     namedtuples.
     """
     if kind not in conn_tmap:
         raise ValueError("invalid %r kind argument; choose between %s" %
                          (kind, ', '.join([repr(x) for x in conn_tmap])))
     families, types = conn_tmap[kind]
     rawlist = _psutil_bsd.get_process_connections(self.pid, families,
                                                   types)
     ret = []
     for item in rawlist:
         fd, fam, type, laddr, raddr, status = item
         status = TCP_STATUSES[status]
         nt = nt_connection(fd, fam, type, laddr, raddr, status)
         ret.append(nt)
     return ret