def METHOD_NAME():
    pid_fd = '/proc/%s/fd' % os.getpid()
    sockets = 0
    for fd in os.listdir(pid_fd):
        try:
            if stat.S_ISSOCK(os.stat(os.path.join(pid_fd, fd)).st_mode):
                sockets += 1
        except OSError as e:
            if e.errno != errno.ENOENT:
                raise
    return sockets