使用socket编程时,使用BIND函数返回值失败的时候可以通过如下函数查看错误码进而定位:
在Windows上:
printf("error=%d\n",WSAGetLastError());
在Linux上使用:
perror("bind error:");
使用socket编程时,使用BIND函数返回值失败的时候可以通过如下函数查看错误码进而定位:
在Windows上:
printf("error=%d\n",WSAGetLastError());
在Linux上使用:
perror("bind error:");