parameters: (self,pid)
return_statement: return connects
docstring: @name 获取进程连接信息
              @author hwliang<2021-08-09>
              @param pid<int>
              @return dict
function: def get_connects(self,pid):
          '''
              @name 获取进程连接信息
              @author hwliang<2021-08-09>
              @param pid<int>
              @return dict
          '''
          connects = 0
          try:
              if pid == 1: return connects
              tp = '/proc/' + str(pid) + '/fd/'
              if not os.path.exists(tp): return connects
              for d in os.listdir(tp):
                  fname = tp + d
                  if os.path.islink(fname):
                      l = os.readlink(fname)
                      if l.find('socket:') != -1: connects += 1
          except:pass
          return connects
function_tokens: def get_connects ( self , pid ) : connects = 0 try : if pid == 1 : return connects tp = '/proc/' + str ( pid ) + '/fd/' if not os . path . exists ( tp ) : return connects for d in os . listdir ( tp ) : fname = tp + d if os . path . islink ( fname ) : l = os . readlink ( fname ) if l . find ( 'socket:' ) != - 1 : connects += 1 except : pass return connects