ithewei 6 年之前
父節點
當前提交
9974841062
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      hsocket.cpp

+ 1 - 1
hsocket.cpp

@@ -66,7 +66,7 @@ int Connect(const char* host, int port, int nonblock) {
         nonblocking(connfd);
         nonblocking(connfd);
     }
     }
     int ret = connect(connfd, (struct sockaddr*)&addr, addrlen);
     int ret = connect(connfd, (struct sockaddr*)&addr, addrlen);
-    if (ret != 0 && ret != EINPROGRESS) {
+    if (ret < 0 && sockerrno != EINPROGRESS) {
         perror("connect");
         perror("connect");
         return -30;
         return -30;
     }
     }