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...)。说明在对套接字上调用某些函数的时候传入了空指针等非法參数,的确如此。
关于错误errno  EFAULT:Bad address
关于错误errno  EFAULT:Bad address
























相关文章:

  • 2021-12-27
  • 2021-10-10
  • 2022-12-23
  • 2021-10-17
  • 2021-11-26
  • 2022-03-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2021-06-10
  • 2021-08-16
  • 2022-12-23
相关资源
相似解决方案