diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index b89a478c8..00b474cb5 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -134,24 +134,20 @@ void Client::connect(size_t addressIndex) auto securityLevel = m_useSecureNetwork ? SecurityLevel::PeerAuth : SecurityLevel::PlainText; try { - if (m_args.m_hostMode) { - LOG((CLOG_NOTE "waiting for server connection on %i port", m_serverAddress.getPort())); - } else { - // resolve the server hostname. do this every time we connect - // in case we couldn't resolve the address earlier or the address - // has changed (which can happen frequently if this is a laptop - // being shuttled between various networks). patch by Brent - // Priddy. - m_resolvedAddressesCount = m_serverAddress.resolve(addressIndex); + // resolve the server hostname. do this every time we connect + // in case we couldn't resolve the address earlier or the address + // has changed (which can happen frequently if this is a laptop + // being shuttled between various networks). patch by Brent + // Priddy. + m_resolvedAddressesCount = m_serverAddress.resolve(addressIndex); - // m_serverAddress will be null if the hostname address is not reolved - if (m_serverAddress.getAddress() != nullptr) { - // to help users troubleshoot, show server host name (issue: 60) - LOG( - (CLOG_NOTE "connecting to '%s': %s:%i", m_serverAddress.getHostname().c_str(), - ARCH->addrToString(m_serverAddress.getAddress()).c_str(), m_serverAddress.getPort()) - ); - } + // m_serverAddress will be null if the hostname address is not reolved + if (m_serverAddress.getAddress() != nullptr) { + // to help users troubleshoot, show server host name (issue: 60) + LOG( + (CLOG_NOTE "connecting to '%s': %s:%i", m_serverAddress.getHostname().c_str(), + ARCH->addrToString(m_serverAddress.getAddress()).c_str(), m_serverAddress.getPort()) + ); } // create the socket @@ -509,11 +505,8 @@ void Client::setupScreen() void Client::setupTimer() { assert(m_timer == NULL); - - if (!m_args.m_hostMode) { - m_timer = m_events->newOneShotTimer(2.0, NULL); - m_events->adoptHandler(Event::kTimer, m_timer, new TMethodEventJob(this, &Client::handleConnectTimeout)); - } + m_timer = m_events->newOneShotTimer(2.0, NULL); + m_events->adoptHandler(Event::kTimer, m_timer, new TMethodEventJob(this, &Client::handleConnectTimeout)); } void Client::cleanup() diff --git a/src/lib/deskflow/ArgParser.cpp b/src/lib/deskflow/ArgParser.cpp index 09ea16234..2a4cdaecb 100644 --- a/src/lib/deskflow/ArgParser.cpp +++ b/src/lib/deskflow/ArgParser.cpp @@ -88,8 +88,6 @@ bool ArgParser::parseClientArgs(deskflow::ClientArgs &args, int argc, const char args.m_enableLangSync = true; } else if (isArg(i, argc, argv, nullptr, "--invert-scroll")) { args.m_clientScrollDirection = deskflow::ClientScrollDirection::INVERT_SERVER; - } else if (isArg(i, argc, argv, nullptr, "--host")) { - args.m_hostMode = true; } else if (isArg(i, argc, argv, nullptr, "client")) { ++i; continue; diff --git a/src/lib/deskflow/ClientApp.cpp b/src/lib/deskflow/ClientApp.cpp index 5bea93c12..2a76a03e7 100644 --- a/src/lib/deskflow/ClientApp.cpp +++ b/src/lib/deskflow/ClientApp.cpp @@ -113,7 +113,6 @@ void ClientApp::help() << " [--yscroll ]" << " [--sync-language]" << " [--invert-scroll]" - << " [--host]" #ifdef WINAPI_XWINDOWS << " [--display ]" << " [--no-xinitthreads]" @@ -131,8 +130,6 @@ void ClientApp::help() << " --sync-language enable language synchronization.\n" << " --invert-scroll invert scroll direction on this\n" << " computer.\n" - << " --host act as a host; invert server/client mode\n" - << " and listen instead of connecting.\n" #if WINAPI_XWINDOWS << " --display when in X mode, connect to the X server\n" << " at .\n" diff --git a/src/lib/deskflow/ClientArgs.h b/src/lib/deskflow/ClientArgs.h index 14bcc44f4..eced0964b 100644 --- a/src/lib/deskflow/ClientArgs.h +++ b/src/lib/deskflow/ClientArgs.h @@ -34,12 +34,6 @@ public: */ ClientScrollDirection m_clientScrollDirection = ClientScrollDirection::SERVER; - /** - * @brief m_hostMode - activates host mode. - * Client starts a listener and waits for a server connection. - */ - bool m_hostMode = false; - /** * @brief m_serverAddress stores deskflow server address */