| 372 | } |
| 373 | |
| 374 | void EmmyFacade::StartupHookMode(int port) { |
| 375 | Destroy(); |
| 376 | |
| 377 | // 1024 - 65535 |
| 378 | while (port > 0xffff) port -= 0xffff; |
| 379 | while (port < 0x400) port += 0x400; |
| 380 | |
| 381 | const auto s = std::make_shared<SocketServerTransporter>(); |
| 382 | std::string err; |
| 383 | const auto suc = s->Listen("localhost", port, err); |
| 384 | if (suc) { |
| 385 | transporter = s; |
| 386 | // transporter->SetHandler(shared_from_this()); |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | void EmmyFacade::Attach(lua_State *L) { |
| 391 | if (!this->transporter->IsConnected()) |
no test coverage detected