fopen()和socket()的内在联系

int portone=socket(AF_INET,SOCK_STREAM, 0);
printf("portone=%d",portone);
printf("open file sucessfully \n push any button to continue\n");
getchar();
int porttwo=socket(AF_INET,SOCK_STREAM, 0);
printf("open file sucessfully \n push any button to continue\n");
printf("porttwo=%d\n",porttwo);
getchar();

//新建文件保存收到的内容
fp=fopen(g_savePath,"wb+");
if (fp == NULL)
{
perror("open file error:");
return -1;
}
int portthree=socket(AF_INET,SOCK_STREAM, 0);
printf("open file sucessfully \n push any button to continue\n");
printf("portthree=%d\n",portthree);
getchar();

为什么调用过fopen之后,再调用socket()返回的端口号就隔了一位

猜你喜欢

转载自www.cnblogs.com/fanshuruo/p/9646724.html