亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

python - How to do port monitoring.
為情所困
為情所困 2017-06-30 09:54:51
0
1
1179

windwos, how to do it like phpstudy. If the port is killed, the light will turn red... If the port is monitored, it will turn green... And it is real-time... Please give me some guidance...

為情所困
為情所困

reply all(1)
僅有的幸福

I have never done a real-time one, but I want to make a semi-real-time one. Use the socket to communicate with the target port every 30 seconds. If the communication fails, it will alarm.

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
    s.connect((conn_ip,conn_port))
    logging.info('IP:'+str(conn_ip)+',PORT:'+str(conn_port)+',connect successful')
except Exception as e:
    logging.warning('IP:'+str(conn_ip)+',PORT:'+str(conn_port)+',connect failed!!check the client!!')
    send_msg(conn_ip,conn_port) #發(fā)送報(bào)警短信
finally:
    s.close()

This is a rough version, that’s what it means...I don’t know if it will be helpful to you

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template