我使用setsockopt
在macOS上设置SO_DEBUG
,但找不到调试输出在哪里。
我在Mac上尝试过控制台app
和dmesg
命令,但没有找到调试输出。
int res;
int debug = 1;
printf("begin set socket option,debug: %d\n",debug);
res = setsockopt(sockfd,SOL_SOCKET,SO_DEBUG,&debug,sizeof(debug));
if(res < 0) {
printf("Error happened when set socket options: %d\n",res);
exit(1);
}
我想查看套接字处理的调试输出。有人可以帮我吗?