在socket服务器程序中使用了servAddr.sin_addr.s_addr = inet_addr("192.168.1.1");时,程序不能自动开机运行。但改成servaddr.sin_addr.s_addr = htonl(INADDR_ANY);后,程序就能自动运行了。