|
e(f_open);
/*-----------------------------
rm tmp file
------------------------------*/
if((ret=system("rm -rf /tmp/tmp.ip"))==-1)
{
perror("system error");
return(-1);
}
/*------------------------------
connect server,and send command
------------------------------*/
//because the host connect to internet by dail,
//so,it is possiabe that host have not connected when it start
//then we sleep 5 miniutes,and try again until the host connect to internet
//we know the connection status by gethostbyname(),but this way is not always correct
while((server_ip=gethostbyname("smtp.163.com"))==NULL)
{
herror("gethostbyname error");
sleep 页码:[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 第6页、共10页 |