#!/usr/bin/env python3
"""检查监听地址"""

import socket
import os
import sys

# 检查端口占用
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = ('0.0.0.0', 8088)

try:
    sock.bind(server_address)
    print(f"✅ 端口 8088 未被占用，可以绑定")
    sock.close()
except socket.error as e:
    print(f"⚠️ 端口 8088 已被占用: {e}")
    
# 查看进程
print(f"\n🔍 当前Python进程:")
os.system('ps -ef | grep python')

# 检查api_for_fixed_rpc.py的监听地址
print(f"\n📝 检查api_for_fixed_rpc.py中的监听配置:")
os.system('grep -n "uvicorn.run\|bind\|host" /app/api_for_fixed_rpc.py')
