| 122 | } |
| 123 | |
| 124 | bool EmmyFacade::TcpConnect(lua_State *L, const std::string &host, int port, std::string &err) { |
| 125 | Destroy(); |
| 126 | |
| 127 | _emmyDebuggerManager.AddDebugger(L); |
| 128 | |
| 129 | SetReadyHook(L); |
| 130 | |
| 131 | const auto c = std::make_shared<SocketClientTransporter>(); |
| 132 | transporter = c; |
| 133 | // c->SetHandler(shared_from_this()); |
| 134 | const auto suc = c->Connect(host, port, err); |
| 135 | if (suc) { |
| 136 | WaitIDE(true); |
| 137 | } else { |
| 138 | lua_pushcfunction(L, LuaError); |
| 139 | lua_pushstring(L, err.c_str()); |
| 140 | lua_call(L, 1, 0); |
| 141 | } |
| 142 | return suc; |
| 143 | } |
| 144 | |
| 145 | bool EmmyFacade::PipeListen(lua_State *L, const std::string &name, std::string &err) { |
| 146 | Destroy(); |
no test coverage detected