【QT】QT学习:如何定位在QT中使用socket绑定bind失败

使用socket编程时,使用BIND函数返回值失败的时候可以通过如下函数查看错误码进而定位:

在Windows上:

printf("error=%d\n",WSAGetLastError());

在Linux上使用:

perror("bind error:");


猜你喜欢

转载自blog.csdn.net/ipfpm/article/details/78295797