可以通过修改PPPd拨号脚本来实现自动重拨(/etc/ppp/peers/gprs),例如:
holdoff 45 //拨号超时45秒maxfail 6 //重拨次数6次
如果用新的进程来重新进行拨号会出现僵死进程(原先的拨号进程),不过可以用waitpid来结束该进程。
if(pid != 0){ if (waitpid(pid,NULL,0) != pid) //等待PPPD僵死进程结束 { printf("Wait pppd pid error!\n"); return; } }
博客园 © 2004-2026 浙公网安备 33010602011771号 浙ICP备2021040463号-3