浏览代码

fix #359: TcpClient::startConnect returns non-zero, causing EventLoopThread::stop

ithewei 2 年之前
父节点
当前提交
c07738acce
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      evpp/TcpClient.h

+ 4 - 1
evpp/TcpClient.h

@@ -275,7 +275,10 @@ public:
         if (isRunning()) {
             TcpClientEventLoopTmpl<TSocketChannel>::start();
         } else {
-            EventLoopThread::start(wait_threads_started, std::bind(&TcpClientTmpl::startConnect, this));
+            EventLoopThread::start(wait_threads_started, [this]() {
+                TcpClientTmpl::startConnect();
+                return 0;
+            });
         }
     }