ithewei 6 years ago
parent
commit
9974841062
1 changed files with 1 additions and 1 deletions
  1. 1 1
      hsocket.cpp

+ 1 - 1
hsocket.cpp

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