首页 > 其他 > 详细

socket : read error Bad address

时间:2014-09-04 11:55:10      阅读:344      评论:0      收藏:0      [点我收藏+]
UDP socket : read error Bad address

在写UDP server,在调用套接字读取的时候发生了这个错误, 通过看errno.h 可以看到对应的错误号  EFAULT:
Bad address (POSIX.1),在stackoverflow上看到的这个解释不错:
It happen if the memory address of some argument passed to sendto (or more generally to any system call) is invalid. Think of it as a sort of SIGSEGV in kernel land regarding your syscall. For instance, if you pass a null or invalid buffer pointer (for reading, writing, sending, recieving...)。说明在对套接字上调用某些函数的时候传入了空指针等非法参数,的确如此。
bubuko.com,布布扣
bubuko.com,布布扣
























socket : read error Bad address

原文:http://blog.csdn.net/vonzhoufz/article/details/39049043

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!