浏览代码

fixbug: macosx udp sendto

hewei.it 5 年之前
父节点
当前提交
8de99036db
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      event/nio.c

+ 1 - 1
event/nio.c

@@ -340,7 +340,7 @@ static int __nio_write(hio_t* io, const void* buf, int len) {
         break;
     case HIO_TYPE_UDP:
     case HIO_TYPE_IP:
-        nwrite = sendto(io->fd, buf, len, 0, io->peeraddr, sizeof(sockaddr_u));
+        nwrite = sendto(io->fd, buf, len, 0, io->peeraddr, SOCKADDR_LEN(io->peeraddr));
         break;
     default:
         nwrite = write(io->fd, buf, len);