不行,我试过了
我得python程序如下:
#! /usr/bin/env python
#
# Filename: PyHBClient.py
"""
PyHeartBeat client
It sends out an UDP packet every 30 seconds
Please adjust the constant parameters as needed
"""
from socket import socket, AF_INET, SOCK_DGRAM
from time import time, ctime, sleep
SERVERIP = '219.219.36.1'
HBPORT = 8002
BEATWAIT = 30
msg='ip: db.db.24.09 mac: 00 e0 4d 00 33 e5'
print "yHeartBeat client sending to IP %s , port %d" % \
(SERVERIP, HBPORT)
print "\n*** Press Ctrl-C to stop ***\n"
while 1:
hbsocket = socket(AF_INET, SOCK_DGRAM)
hbsocket.sendto(msg, (SERVERIP, HBPORT))
if __debug__:
print "Time: %s" % ctime(time())
sleep(BEATWAIT)
ip地址我已经实时的进行了更改
但仍然只能维持约3分钟的上网时间,此后就断了.
不知道我改的程序是否有问题,另外我是直接在终端里执行PyHBClient.py的 |